I am trying to send mail using Google SMTP in combination with PHPMailer, but I cannot get it to work. This is my code:
$mail->IsSMTP(); $mail->Host = "smtp.gmail.com"; $mail->SMTPAuth = true; $mail->SMTPSecure = "ssl"; $mail->Username = " myemail@gmail.com "; $mail->Password = "**********"; $mail->Port = "465";
At first I donβt quite understand what should be filled in as "SMTPSecure", some say " ssl ", others say " tls ". Further for "Port" I can enter "465" or "587". But none of the combinations work ... Please note that I am using a regular Gmail account and not Google Apps. In my Gmail account, I have enabled "access to POP".
I get the error: " Must issue a STARTTLS command first ". This means that SSL failed, but I donβt know why ...
source share