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 SMTP server and gmail using STARTTLS which is secure SSL and i already use these commands in my contact.php file
ini_set("SMTP","smtp.gmail.com"); ini_set("sendmail_from","<email-address>@gmail.com>");
so what command i can use to enable STARTTLS or configure in php,ini file??
StartTLS is a protocol command used to inform the email server that the email client wants to upgrade from an insecure connection to a secure one using TLS or SSL. StartTLS is used with SMTP and IMAP, while POP3 uses the slightly different command for encryption, STLS.
Use smtp.gmail.com instead of smtp.google.com. Use port 587. Set client. UseDefaultCredentials = false; before setting credentials.
First, make sure you PHP installation has SSL support (look for an "openssl" section in the output from phpinfo()
).
You can set the following settings in your PHP.ini:
ini_set("SMTP","ssl://smtp.gmail.com"); ini_set("smtp_port","465");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With