欢迎光临
我们一直在努力

网上找到的两个PHP发送邮件的例子,很不错,贴出来给初学者参考吧(不知道是否有兄弟曾贴过),呵呵(2)-PHP教程,邮件处理

建站超值云服务器,限时71元/月

advanced example

here we will show the full capabilities of the php mail function.

php code:
<?php

echo "<html><body>";

$recipient = "kris arndt <karn@nucleus.com>,npl@nucleus.com";
$subject = "testing the mail function";
$message = "hello!\n\nthis is the body of the message.\n\n";
$extra = "from: kris@phpworld.com\r\nreply-to: karn@nucleus.com\r\n";

mail ($recipient, $subject, $message, $extra);

echo "sending mail…";
echo "</body></html>";

?>

we send an email to two people this time, by putting two email addresses in the recipient field and separating them with commas.

the fourth parameter holds extra headers for the email.  we specify who the email was from and who the recipient should reply to.  when entering multiple headers, separate them with the line feed and new line combination (\r\n).

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 网上找到的两个PHP发送邮件的例子,很不错,贴出来给初学者参考吧(不知道是否有兄弟曾贴过),呵呵(2)-PHP教程,邮件处理
分享到: 更多 (0)

相关推荐

  • 暂无文章