Intepreting debug info from trying to use gmail as SMTP to send mail with PHP
I used a PHP library to try and use my gmail account to send mails. Just an experiment, to see if I can set it up. After succesfully completing the send() method, I request debug information. This is what was shown to me:
220 mx.google.com ESMTP g9sm901968gvc.25
250 mx.google.com at your service
530 5.7.0 Must issue a STARTTLS command first. g9sm901968gvc.25
530 5.7.0 Must issue a STARTTLS command first. g9sm901968gvc.25
530 5.7.0 Must issue a STARTTLS command first. g9sm901968gvc.25
530 5.7.0 Must issue a STARTTLS command first. g9sm901968gvc.25
530 5.7.0 Must issue a STARTTLS command first. g9sm901968gvc.25
530 5.7.0 Must issue a STARTTLS command first. g9sm901968gvc.25
530 5.7.0 Must issue a STARTTLS command fir开发者_JAVA技巧st. g9sm901968gvc.25
I can see that something must have gone wrong, but I have no idea what to make of this.
Also, I am working on Windows 7 with PHP here.
You need to issue a code 250 STARTTLS command to the server. You'll probably want to make sure that the PHP mailer you're using can handle TLS communications. I recommend SwiftMailer.
精彩评论