Reputation: 27
I am using PHPMailer() to send mail using PHP with host smtp.gmail.com
(port 465). However, I always get this error message:
SMTP -> FROM SERVER:220 mx.google.com ESMTP g7sm2712458obh.2 - gsmtp
SMTP -> FROM SERVER: 250-mx.google.com at your service, [125.5.102.200] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-CHUNKING 250 SMTPUTF8
SMTP -> FROM SERVER:220 2.0.0 Ready to start TLS
Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in ##### on line 200
I have searched for some solution but it always say that I have to edit php.ini
file. I don't know how to edit such document since I am running the code in a hosted server.
Upvotes: 0
Views: 967
Reputation: 37810
It looks like you are connecting to a TLS port, not an SSL one. I suggest you base your code on the gmail example provided with PHPMailer. Use SMTPSecure = 'tls'
and Port = 587
.
Beyond that, it looks like you may not have SSL support enabled in your PHP - check php -m
output for openssl
, and see the troubleshooting guide.
Upvotes: 1