使用PHP向Muti收件人发送电子邮件 [英] Send E-mail to Muti Receipients in PHP

查看:171
本文介绍了使用PHP向Muti收件人发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在php中使用mail()函数发送给某人,但它始终显示错误:警告:mail()[function.mail]:无法在"localhost"端口25上连接到邮件服务器,请验证您的"php.ini中的"SMTP"和"smtp_port"设置,或在第7行的C:\ wamp \ www \ PHP \ Email \ sent_mail.php中使用ini_set() 我们在发送您的邮件时遇到错误"

------------
我的代码:

$ to ="abc@gmail.com";
$ subject =测试";
$ email ="dsb@gmail.com"
$ message =你好"
$ headers =发件人:$ email";
$ sent = mail($ to,$ subject,$ message,$ headers);
if($ sent)
{打印您的邮件已成功发送"}
其他
{print我们在发送您的邮件时遇到错误"}

I try to use mail() function in php to sent to someone but it always show error :"Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\PHP\Email\sent_mail.php on line 7
We encountered an error sending your mail"

------------
my code:

$to = "abc@gmail.com";
$subject = "Test";
$email = "dsb@gmail.com"
$message = "Hello"
$headers = "From:$email";
$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Your mail was sent successfully" }
else
{print "We encountered an error sending your mail" }

推荐答案

到="abc@gmail.com";
to = "abc@gmail.com";


主题=测试";
subject = "Test";


电子邮件="dsb@gmail.com"
email = "dsb@gmail.com"


这篇关于使用PHP向Muti收件人发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆