Skip to content
Advertisement

SMTP connect() failed PHPmailer – PHP

I am new to PHP. I was trying to send myself a sample e-mail through PHPmailer. I am using gmail’s smtp server. I am trying to send a sample mail from my gmail account to my yahoo account. But I am getting the error : Mailer Error: SMTP connect() failed.
Here is the code :

JavaScript

I am using WAMP server on a Windows 7 64-bit machine. What could be the prob?
Please help me solve this. Thanks!

Advertisement

Answer

You need to add the Host parameter

JavaScript

Also, check if you have open_ssl enabled.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement