-1

I have recently learned about this mailing system called PHPMailer and I started testing it out.

Initially, I did the testing locally on localhost (using the free MAMP server) and everything worked perfectly fine. Then I uploaded my contents onto my website, only to realise that it did not work online.

Below is the debugging report with $mail->SMTPDebug = 2;:

SERVER -> CLIENT: 220-a2plcpnl0392.prod.iad2.secureserver.net ESMTP Exim 4.85 #2 Thu, 28 Jan 2016 00:03:50 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
CLIENT -> SERVER: EHLO test.naitsabes.com
SERVER -> CLIENT: 250-a2plcpnl0392.prod.iad2.secureserver.net Hello a2plcpnl0392.prod.iad2.secureserver.net [198.71.231.68]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 TLS go ahead
CLIENT -> SERVER: EHLO test.naitsabes.com
SERVER -> CLIENT: 250-a2plcpnl0392.prod.iad2.secureserver.net Hello a2plcpnl0392.prod.iad2.secureserver.net [198.71.231.68]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250 HELP
CLIENT -> SERVER: AUTH LOGIN
SERVER -> CLIENT: 334 xxx
CLIENT -> SERVER: ZGxldW5nQGNvbm5lY3Qua2VsbGV0dHNjaG9vbC5jb20=
SERVER -> CLIENT: 334 xxx
CLIENT -> SERVER: OTYxYmVlcGJlZXAxNjk=
SERVER -> CLIENT: 535 Incorrect authentication data
SMTP ERROR: Password command failed: 535 Incorrect authentication data
SMTP Error: Could not authenticate.
CLIENT -> SERVER: QUIT
SERVER -> CLIENT: 221 a2plcpnl0392.prod.iad2.secureserver.net closing connection
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

It seems to me that Gmail says the password is incorrect or something (but what do I know, this is the first time I used PHPMailer), but I'm not sure what exactly has gone wrong as the PHP code in my local server is perfectly identical which means the password should be correct.

In case this helps, my faulty (???) code is located at http://test.naitsabes.com but it is password protected to avoid people spamming my Gmail inbox. However, if it helps to enter the protected area for debugging purposes, there is a temporary login account with both username and password set to visitor.

I will also provide the link to my source code (on GitHub) upon request but I won't do so on this post to avoid being misunderstood as spamming external links.

Thank you, and much help will be appreciated :)

P.S. I know this question has been posted once by someone else already but by the looks of it, the (original) question is still unsolved with not a single answer.

Synchro
  • 35,538
  • 15
  • 81
  • 104
  • could you please post your phpmailer parameters minus the username/password – mani Jan 28 '16 at 07:47
  • If you had followed the link to the troubleshooting guide you would see that (as Hidde's answer says) connecting from GoDaddy is a very well known problem and answered many times on here. – Synchro Jan 28 '16 at 08:39
  • Possible duplicate of [PHP on GoDaddy Linux Shared trying to send through GMAIL SMTP](http://stackoverflow.com/questions/5440026/php-on-godaddy-linux-shared-trying-to-send-through-gmail-smtp) – Synchro Jan 28 '16 at 08:41

2 Answers2

0

First of all, make sure you enabled outgoing SMTP connections in your Control Panel (assuming you are running on a shared webhost).

If that doesn't work, please share the mail part of your code.

0

The problem seems to be your host (godaddy.com) preventing you from connecting to SMTP servers other then theirs. The request never hits any Google server (secureserver.net is a godaddy.com server).

To really solve this problem I would contact them to be sure this is the case and read this article about SMTP email relays as described here

Community
  • 1
  • 1
Hidde
  • 103
  • 7