在本地邮件中运行PHPMailer时将发送消息,但在托管PHPMailer时显示错误,因为SMTP connect()失败。 https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting。请帮我。
这是我的代码
<br/>
答案 0 :(得分:0)
好吧,让我们说清楚点吧:
vardump or something else
我的代码示例:
require(https://example.com/PHPMailerAutoload.php');
require(https://example.com/class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'mail.example.com';
$mail->SMTPAuth = TRUE;
$mail->Username = 'customer_service@example.com';
$mail->Password = 'blablabla';
$mail->From = 'customer_service@example.com';
$mail->setFrom('customer_service@example.com', 'My Cool Website');
$mail->AddAddress('recipient@destination.com', 'Recipient Full Name');
$mail->WordWrap = 70;
$mail->Subject = 'PHP Mailer';
$mail->Body = 'Awesome';
$mail->IsHTML(TRUE);