Я пытаюсь в течение нескольких дней отправлять электронные письма с моего сайта через учетную запись godaddy. Я не знаю, есть ли какая-либо специальная конфигурация на стороне сервера (godaddy) Я не знаю, не ошиблась ли я с моим кодом php. Мне действительно нужно выяснить, как я могу отправить электронную почту. Спасибо, Рикардо.Как отправить электронную почту через godaddy с помощью PHPMailer?
enter code here
try {
//Create a new PHPMailer instance
$mail = new PHPMailer();
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
$mail->DKIM_domain = '**********';
$mail->Debugoutput = 'html';
$mail->Host = "a2plcpnl0321.prod.iad2.secureserver.net";
$mail->Port = 465;
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "***************.com";
//Password to use for SMTP authentication
$mail->Password = "**99KKll";
$mail->SMTPSecure = 'ssl';
//Set who the message is to be sent from
$mail->setFrom('****************.com', '*******');
//Set an alternative reply-to address
//$mail->addReplyTo('[email protected]', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('**************.com', '*****');
//Set the subject line
$mail->Subject = 'PHPMailer SMTP test';
$mail->Body = "<i>This is the Link to change your password:</i>";
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message sent!";
}
print_r($mail);
Так .... '$ mail-> ErrorInfo' ничего не производит? Пожалуйста, поделитесь своими секретами – MonkeyZeus