SMTP server response: 530 5.7.0 Must issue a STARTTLS command first
I get this error message when i use mail() function in php script file...
I m using gmail
I know that PHPMailer library can handle that kind of SMTP transactions.
Also, a fake sendmail with sendmail-SSL library should do the job.
For Windows, I was able to get it working by enabling TLS for secure communication on the SMTP Virtual server. TLS will not be available on the SMTP virtual server without a certificate. This link will give the steps needed.
https://support.microsoft.com/en-ie/help/4014125/how-to-configure-iis-smtp-for-outgoing-tls-authentication
In my case, Swift Mailer couldn't help either. I found a solution here: http://forum.powweb.com/showthread.php?t=73406 - so after EHLO command one needs to send STARTTLS command, enabling cryptography with stream_socket_enable_crypto( $connection, true, STREAM_CRYPTO_METHOD_TLS_CLIENT );
and again EHLO command. Only this allowed me to send emails with my "stubborn" SMTP server.