senden Sie E-Mail mit Gmail-SMTP-server über PHP-Mailer

Ich möchte senden Sie eine E-Mail mit Gmail-SMTP - server durch PHP Mailer.

dies ist mein code

<?php
require_once('class.phpmailer.php');

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet="UTF-8";
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Username = '[email protected]';
$mail->Password = 'valid password';
$mail->SMTPAuth = true;

$mail->From = '[email protected]';
$mail->FromName = 'Mohammad Masoudian';
$mail->AddAddress('[email protected]');
$mail->AddReplyTo('[email protected]', 'Information');

$mail->IsHTML(true);
$mail->Subject    = "PHPMailer Test Subject via Sendmail, basic";
$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!";
$mail->Body    = "Hello";

if(!$mail->Send())
{
  echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
  echo "Message sent!";
}
?>

aber ich erhalte folgende Fehlermeldung

Mailer Error: SMTP Error: The following recipients failed: anotherValidGmail@gmail.com

SMTP server error: SMTP AUTH is required for message submission on port 587

meine domain ist vatandesign.ir

Möchten Sie vielleicht einen Blick auf Jorj ' s Antwort auf diesen thread: stackoverflow.com/questions/5759419/...

InformationsquelleAutor Mohammad Masoudian | 2013-04-16

Schreibe einen Kommentar