Ben PHPMailer ve GMail SMTP kullanarak e-postalar göndermek için çalışıyorum. Bu güzel, diğer Gmail hesaplarına e-posta göndermek, ancak posta orada geçmez Yahoo göndererek çalışır. Ben ip adresleri ve bu tür kullanarak hata ayıklama hakkında okudum, ama ben o bölgede yetenekli değilim?
burada kodu:
$mail->Mailer='smtp';
try {
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "__email__"; // GMAIL username
$mail->Password = "__pass__"; // GMAIL password
$mail->SMTPDebug = 2;
$a = md5(uniqid(rand(), true)); //create a unique validation code
//These are the variables for the email
$mail->AddAddress (trim($_POST['email']),trim($_POST['username'])); // this is the email address collected form the form
$mail->Subject = "Registration"; // Subject
$mail->Body = "Thank you for registering\n your security code is ".$a;
$mail->Send();
echo "check your email to complete registration";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
$mail->ClearAddresses();
update: Found the problem: Our server had been blacklisted by Yahoo (not my fault) so that's a day-and-a-half wasted.