I am aware that this has been asked (and answered) often, but the
solutions are not working for me.
I get this error from last days, and I tried everything :
I changed the port and the host and the SMTPSecure to (ssl / 465).
The port is open (587 and 465).
My php installation has SSL support.
The php function mail() worked perfectly
I have the last version of phpmailer
When i put the smtpAuth , i have an other line error (ERROR: AUTH not
accepted from server: 530 5.7.0 Must issue a STARTTLS command first.)I put my php.ini configuration :
SMTP = smtp.gmail.com
smtp_port = 587I also tried (it seems more logical) : SMTP = smtp.myFAI.com
smtp_port = 25
I think it's more a php issue than the code.
Thank you for reading my annoying post ! And if you have any ideas...
$mail=new PHPMailer();
$mail->IsSMTP();
$mail->SMTPSecure = 'tls';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 587;
$mail->Password='password';
$mail->SetFrom("my_email", 'Me');
$mail->AddAddress("email_to", "");
$mail->From = "my_email";
$mail->FromName= "Me";
$mail->IsHTML(false);
$mail->Subject="Subject";
$mail->Body = "message";
if(!$mail->Send()){echo "not sent";}
else{echo "Sent";}
No comments:
Post a Comment