Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

587, starttls, smtpauth true or false

I want this to work with starttls

port 465 works fine
I am asking about port 587 on this question

$mail->IsSMTP(); // telling the class to use SMTP
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "starttls";                 // sets the prefix to the servier
$mail->Host       = "";      // sets GMAIL as the SMTP server
$mail->Port       = 587;                   // set the SMTP port for the GMAIL server

Open in new window

SMTP -> FROM SERVER:220 ESMTP nd14sm25663016obb.14
SMTP -> FROM SERVER: at your service, [myIPaddress] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250 PIPELINING
SMTP -> ERROR: AUTH not accepted from server: 530 5.7.0 Must issue a STARTTLS command first. nd14sm25663016obb.14
SMTP -> FROM SERVER:250 2.1.5 Flushed nd14sm25663016obb.14
SMTP Error: Could not authenticate.

$mail->SMTPSecure = "tls";                 // sets the prefix to the servier
but I want to try
$mail->SMTPSecure = "starttls";                 // sets the prefix to the servier
same error for both
$mail->SMTPAuth   = true;   and $mail->SMTPAuth   = false
Avatar of Aaron Tomosky
Aaron Tomosky
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192


thanks, link worked