Hi. I've created an email id firstname.lastname@example.org and I'm able to send and receive mails through this id if I use Usermin. I've also used following settings to add this id to GMAIL (as sender) and I'm able to send mails through GMAIL as well.
Password: **My password**
Port 587 (tls)
When I used PHPMailer in my website with following settings. I get an error that says 'Failed to connect to SMTP server'
$mail = new PHPMailer;
$mail->SMTPDebug = 2;
$mail->Host = "mail.domian.com";
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'TLS';
$mail->Port = 587;
$mail->Username = "info.domian";
$mail->Password = 'mypassword';
$mail->setFrom('email@example.com', 'Website Name');
$mail->addReplyTo('firstname.lastname@example.org', 'Website Name');
I've also tried Telnet to ping the host and that works too. I don't know what's the problem here.