<?php
//SMTP server settings
$host = "smtp.host.com";
$port = "587";
$username = "";
$password = "";
$messageBody = "";
if($_POST['name']!='false'){
$messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['email']!='false'){
$messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}else{
$headers = '';
}
if($_POST['state']!='false'){
$messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['phone']!='false'){
$messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['fax']!='false'){
$messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
$messageBody .= '<br>' . "\n";
}
if($_POST['message']!='false'){
$messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
}
if($_POST["stripHTML"] == 'true'){
$messageBody = strip_tags($messageBody);
}
if($host=="" or $username=="" or $password==""){
$owner_email = $_POST["owner_email"];
$headers = 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n";
$subject = 'A message from your site visitor ' . $_POST["name"];
try{
if(!mail($owner_email, $subject, $messageBody, $headers)){
throw new Exception('mail failed');
}else{
echo 'mail sent';
}
}catch(Exception $e){
echo $e->getMessage() ."\n";
}
}else{
require_once 'Mail.php';
$to = $_POST["owner_email"];
$subject = 'A message from your site visitor ' . $_POST["name"];
$headers = array (
'From' => 'From:' . $_POST["email"] . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n",
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory(
'smtp',
array (
'host' => $host,
'port' => $port,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $messageBody);
try{
if(PEAR::isError($mail)){
echo $mail->getMessage();
}else{
echo 'mail sent';
}
}catch(Exception $mail){
echo $mail->getMessage() ."\n";
}
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
html5模板-欧美风范HTML5网站模板.zip (93个子文件)
html5模板-欧美风范HTML5网站模板
index-1.html 8KB
screenshots
photography_theme_b.jpg 97KB
photography_theme_th.jpg 24KB
js
PIE.php 613B
sForm.js 3KB
PIE.htc 40KB
TMForm.js 31KB
html5shiv.js 2KB
superfish.js 7KB
owl.carousel.js 28KB
tmStickUp.js 2KB
jquery.mobilemenu.js 2KB
jquery.easing.1.3.js 8KB
jquery.equalheights.js 1KB
jquery.js 91KB
touchTouch.jquery.js 6KB
jquery-migrate-1.1.1.js 17KB
jquery.mobile.customized.min.js 17KB
jquery.ui.totop.js 2KB
camera.js 68KB
script.js 1KB
bat
MailHandler-sub.php 1KB
MailHandler.php 2KB
index-3.html 8KB
css
style.css 15KB
superfish.css 5KB
camera.css 7KB
owl.carousel.css 2KB
stuck.css 922B
font-awesome.css 21KB
form.css 7KB
grid.css 6KB
ie.css 963B
touchTouch.css 2KB
index-4.html 8KB
index-2.html 13KB
index.html 13KB
images
page2_img3.jpg 43KB
car_img3.jpg 55KB
full8.jpg 175KB
car_img7.jpg 25KB
magnify.png 2KB
page1_img1.jpg 69KB
totop.png 5KB
big2.jpg 71KB
page4_img1.jpg 88KB
full1.jpg 114KB
slide2.jpg 353KB
car_img6.jpg 52KB
page1_img4.jpg 58KB
big1.jpg 95KB
full9.jpg 111KB
full7.jpg 287KB
big5.jpg 59KB
page2_img4.jpg 55KB
big3.jpg 61KB
full3.jpg 75KB
logo.png 4KB
page2_img5.jpg 61KB
page1_img3.jpg 49KB
full2.jpg 62KB
page2_img7.jpg 163KB
big6.jpg 102KB
car_img5.jpg 36KB
slide1.jpg 499KB
full4.jpg 80KB
camera-loader.gif 3KB
prevnext1.png 4KB
page1_img2.jpg 52KB
slide.jpg 520KB
page1_img5.jpg 57KB
arrowws.png 2KB
big4.jpg 69KB
page2_img8.jpg 101KB
page4_img2.jpg 68KB
page2_img6.jpg 62KB
page2_img2.jpg 42KB
preloader.gif 3KB
car_img1.jpg 25KB
full5.jpg 112KB
car_img2.jpg 23KB
page2_img1.jpg 78KB
full6.jpg 112KB
page2_img9.jpg 77KB
page4_img3.jpg 75KB
prevnext.png 5KB
car_img4.jpg 24KB
page1_img6.jpg 65KB
fonts
FontAwesome.otf 61KB
fontawesome-webfont.eot 37KB
fontawesome-webfont.woff 43KB
fontawesome-webfont.svg 197KB
fontawesome-webfont.ttf 79KB
共 93 条
- 1
资源评论
GJZGRB
- 粉丝: 1638
- 资源: 6448
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功