godaddy php mail,Php Mailer错误 - Godaddy Smtp

我有一个项目,我必须向用户发送100-200封邮件,但每个邮件对每个用户都有不同的令牌 . 我在godaddy上托管了电子邮件 .

所以我想用phpmailer发送电子邮件 . 下面是我正在测试的脚本,但它一直给我这个错误 -

//SMTP needs accurate times, and the PHP time zone MUST be set

//This should be done in your php.ini, but this is how to do it if you don't have access to that

date_default_timezone_set('Etc/UTC');

require 'mailm/PHPMailerAutoload.php';

//Create a new PHPMailer instance

$mail = new PHPMailer();

//Tell PHPMailer to use SMTP

$mail->isSMTP();

//Enable SMTP debugging

// 0 = off (for production use)

// 1 = client messages

// 2 = client and server messages

$mail->SMTPDebug = 2;

$mail->DKIM_domain = '127.0.0.1';

//Ask for HTML-friendly debug output

$mail->Debugoutput = 'html';

//Set the hostname of the mail server

$mail->Host = "smtpout.secureserver.net";

//Set the SMTP port number - likely to be 25, 465 or 587

$mail->Port = 465;

//Whether to use SMTP authentication

$mail->SMTPAuth = true;

//Username to use for SMTP authentication

$mail->Username = "itsupport@mysite.ae";

//Password to use for SMTP authentication

$mail->Password = "Mypassword";

$mail->SMTPSecure = 'ssl';

//Set who the message is to be sent from

$mail->setFrom('itsupport@mysite.ae', 'IT Helpdesk');

//Set an alternative reply-to address

//$mail->addReplyTo('replyto@example.com', 'First Last');

//Set who the message is to be sent to

$mail->addAddress('sgajara@gmail.com', 'IT Helpdesk');

//Set the subject line

$mail->Subject = 'PHPMailer SMTP test';

//Read an HTML message body from an external file, convert referenced images to embedded,

//convert HTML into a basic plain-text alternative body

//Replace the plain text body with one created manually

$mail->Body = 'This is a plain-text message body';

//Attach an image file

//send the message, check for errors

if (!$mail->send()) {

echo "Mailer Error: " . $mail->ErrorInfo;

} else {

echo "Message sent!";

}

?>

我在博客上找到了这个脚本 .

我也欢迎任何替代方案,我的目的是从我的godaddy电子邮件帐户发送200封电子邮件,但每封电子邮件都有一个单独的令牌,该令牌从数据库中提取,然后插入邮件正文并发送给用户 .

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值