php如何实现带抄送和密件抄送的邮件发送-创新互联
这篇文章主要介绍了php如何实现带抄送和密件抄送的邮件发送,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。
创新互联专注于企业成都全网营销、网站重做改版、镶黄网站定制设计、自适应品牌网站建设、html5、商城系统网站开发、集团公司官网建设、成都外贸网站建设公司、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为镶黄等各大城市提供网站开发制作服务。具体分析如下:
程序中用到了php的mail函数,该函数定义如下:
bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )
如果邮件发送成功返回True,否则返回False
Send email with CC and BCC
后端php代码,保存为sendmail.php
Send Mail Script " ; } if ( empty ( $mailsubject) ) { $mailsubject=" "; } if (($mailpriority>0) && ($mailpriority<6)) { $mailheader = "X-Priority: ". $mailpriority ."\n"; } $mailheader.= "From: " . "Sales Team\n"; $mailheader.= "X-Sender: " . "support@yourdomain.com\n"; $mailheader.= "Return-Path: " . "support@yourdomain.com\n"; if (!empty($mailcc)) { $mailheader.= "Cc: " . $mailcc ."\n"; } if (!empty($mailbcc)) { $mailheader.= "Bcc: " . $mailbcc ."\n"; } if (empty($mailbody)) { $mailbody=" "; } $result = mail ($to, $mailsubject, $mailbody, $mailheader); echo " Mail sent to ". "$to". "
"; echo $mailsubject. "
"; echo $mailbody. "
"; echo $mailheader. "
"; if ($result) { echo "Email sent successfully!
"; }else{ echo "Email could not be sent.
"; } ?>
To CC BCC Priority Subject Message
感谢你能够认真阅读完这篇文章,希望小编分享的“php如何实现带抄送和密件抄送的邮件发送”这篇文章对大家有帮助,同时也希望大家多多支持创新互联网站建设公司,,关注创新互联行业资讯频道,更多相关知识等着你来学习!
网页名称:php如何实现带抄送和密件抄送的邮件发送-创新互联
网站路径:http://hbruida.cn/article/ccssge.html