Php SMTP电子邮件不发送
我正在尝试通过smtp发送电子邮件,但不幸的是,它没有被发送。似乎没有错误。我哪里出错了Php SMTP电子邮件不发送,php,smtp,Php,Smtp,我正在尝试通过smtp发送电子邮件,但不幸的是,它没有被发送。似乎没有错误。我哪里出错了 require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP $mail->Host = "mail.site.org"; // SMTP servers $mail->SMTPAuth =
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.site.org"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "info@site.org"; // SMTP username
$mail->Password = "123456"; // SMTP password
$mail->From = "info@bosiadbodrum.org"; // smtp kullanıcı adınız ile aynı olmalı
$mail->Fromname = "giden ismi";
$mail->AddAddress("info@alanadi.com","Ornek Isim");
$mail->Subject = $_POST['baslik'];
$mail->Body = implode(" ",$_POST);
if(!$mail->Send())
{
echo "Mail couldnt send <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Mail sent";
require(“class.phpmailer.php”);
$mail=new PHPMailer();
$mail->IsSMTP();//通过SMTP发送
$mail->Host=“mail.site.org”;//SMTP服务器
$mail->SMTPAuth=true;//启用SMTP身份验证
$mail->Username=”info@site.org"; // SMTP用户名
$mail->Password=“123456”//SMTP密码
$mail->From=”info@bosiadbodrum.org"; // smtp kullanıcıadınız ile aynıolmalı
$mail->Fromname=“giden ismi”;
$mail->AddAddress(“info@alanadi.com“,“Ornek Isim”);
$mail->Subject=$\u POST['baslik'];
$mail->Body=内爆(“,$\u POST);
如果(!$mail->Send())
{
echo“邮件无法发送”;
回显“邮件错误:”.$mail->ErrorInfo;
出口
}
回显“已发送邮件”;
尝试此操作,以获取错误:
require("class.phpmailer.php");
$mail = new PHPMailer(true);
try {
$mail->IsSMTP(); // send via SMTP
$mail->Host = "mail.site.org"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "info@site.org"; // SMTP username
$mail->Password = "123456"; // SMTP password
$mail->From = "info@bosiadbodrum.org"; // smtp kullanıcı adınız ile aynı olmalı
$mail->Fromname = "giden ismi";
$mail->AddAddress("info@alanadi.com","Ornek Isim");
$mail->Subject = $_POST['baslik'];
$mail->Body = implode(" ",$_POST);
$mail->Send();
echo "Message Sent OK\n";
}
catch (phpmailerException $e) {
echo $e->errorMessage();
}
catch (Exception $e) {
echo $e->getMessage();
}
那么运行它时的输出是什么?您是否看到
邮件无法发送
消息或邮件已发送
消息?您是否有SMTP服务器?日志中有什么?是的,我有Smtp服务器。我在网上用一个检查脚本检查了它。问题是在发送邮件之后。我收到“已发送邮件”报告,但我没有收到邮件。谢谢您的帮助。发送完这封信后,我收到了“信息发送”报告。但不发送邮件到我的邮箱。SMTP日志中是否显示任何内容?