<?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模板下载.rar
共76个文件
jpg:28个
js:12个
css:10个
需积分: 0 0 下载量 200 浏览量
2023-09-10
10:24:59
上传
评论
收藏 2.83MB RAR 举报
温馨提示
html资源
资源推荐
资源详情
资源评论
收起资源包目录
HTML5主题餐厅网站模板是一款适合餐饮美食网站的HTML5模板下载.rar (76个子文件)
page2_img3.jpg 13KB
style.css 11KB
superfish.css 1KB
index-1.html 7KB
blur.svg 144B
page3_img3.jpg 33KB
magnify.png 2KB
totop.png 5KB
PIE.php 613B
big2.jpg 547KB
ie1.css 631B
forms.js 6KB
page4_img1.jpg 31KB
FontAwesome.otf 61KB
PIE.htc 40KB
TMForm.js 31KB
big1.jpg 317KB
overlay.png 1KB
big5.jpg 76KB
page2_img4.jpg 17KB
page3_img1.jpg 32KB
fontawesome-webfont.eot 37KB
big3.jpg 87KB
page5_img1.jpg 28KB
pint.png 4KB
logo.png 9KB
box_img2.jpg 30KB
map.js 2KB
font-awesome.css 21KB
big6.jpg 113KB
blur_img1.jpg 273KB
page3_img4.jpg 32KB
fontawesome-webfont.woff 43KB
blur_img2.jpg 155KB
box_img3.jpg 36KB
reset.css 771B
box_img4.jpg 31KB
index-3.html 7KB
index-4.html 6KB
favicon.ico 31KB
html5shiv.js 2KB
menu.css 4KB
superfish.js 4KB
arrowws.png 2KB
index-2.html 11KB
f_logo.png 7KB
index.html 6KB
link_marker.png 1KB
form.css 4KB
big4.jpg 375KB
index-5.html 8KB
page4_img2.jpg 38KB
page3_img6.jpg 32KB
MailHandler.php 2KB
fontawesome-webfont.svg 197KB
marker.png 1KB
page3_img2.jpg 40KB
page2_img.jpg 37KB
jquery.tabs.min.js 497B
fontawesome-webfont.ttf 79KB
jquery.easing.1.3.js 8KB
blur_img3.jpg 117KB
page2_img2.jpg 12KB
jquery.equalheights.js 1KB
jquery.js 91KB
grid.css 5KB
preloader.gif 9KB
ie.css 601B
touchTouch.css 2KB
touchTouch.jquery.js 6KB
jquery-migrate-1.1.1.js 17KB
page2_img1.jpg 11KB
box_img1.jpg 32KB
jquery.ui.totop.js 2KB
page3_img5.jpg 29KB
page4_img3.jpg 33KB
共 76 条
- 1
资源评论
Q_97095639
- 粉丝: 377
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功