views:

115

answers:

1

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 first. 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.

+1  A: 

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.

Matt Huggins
Thanks, but I'm on Windows :p
WebDevHobo
You're on Windows, so what? I stand by everything I said.
Matt Huggins
SwiftMailer appears to be a tar.gz download... unless ofcourse the creators simply use it as a shell, as you would like a zip... a tar.gz is usually only meant for linux.
WebDevHobo
.tar.gz is an archive file that can be opened on any platform that has something that can interpret that file type. Neither Windows nor Linux has a built-in method of reading it, they rely on apps to do it (e.g. the `tar` executable on Linux). Download something that can open .tar.gz / .tgz on Windows, that's all. The archived files will still be PHP classes that accomplish what you're looking for, and those can run on Windows just like they run on Linux.
Matt Huggins