Krimson
Krimson

Reputation: 7664

Gmail SMTP issue

I have a problem sending an email using gmail's smtp server

Let me explain my situation. 1 week ago, i could send emails using php using smtp. Yesterday my host shifted their websites including mine to a different server. After that i am not able to send emails. I tested the email scripts on my local machine and it worked just fine.

I am currently using phpmailer to send emails. When the error occurred, i enabled debugging on the php script. I ran the debugging enable version on the remote web server and my local machine.

Here is the output: Local machine (works)

SMTP -> FROM SERVER:220 mx.google.com ESMTP dj6sm9229359qab.3 
SMTP -> FROM SERVER: 250-mx.google.com at your service, [155.41.29.55] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 250 ENHANCEDSTATUSCODES 
SMTP -> FROM SERVER:250 2.1.0 OK dj6sm9229359qab.3 
SMTP -> FROM SERVER:250 2.1.5 OK dj6sm9229359qab.3 
SMTP -> FROM SERVER:354 Go ahead dj6sm9229359qab.3 
SMTP -> FROM SERVER:250 2.0.0 OK 1350437987 dj6sm9229359qab.3 
Message sent!

remote server (doesnt work)

SMTP -> FROM SERVER:220-gds-wh1.get-sourced.net ESMTP Exim 4.80 #2 Tue, 16 Oct 2012 21:00:32 -0500 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. 
SMTP -> FROM SERVER: 250-gds-wh1.get-sourced.net Hello gds-wh1.get-sourced.net [63.141.244.218] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP 
SMTP -> ERROR: Password not accepted from server: 535 Incorrect authentication data 
SMTP -> FROM SERVER:250 Reset OK 
SMTP Error: Could not authenticate. Mailer Error: SMTP Error: Could not authenticate.

If you look closly. In my local machine it seems to have the google's mx-server address in the debug info, but in the remote machine it has the hosting providers info. I don't know if this is normal or not. I am totaly clueless

Could you help me or give me a clue as to what is wrong?

thanks, Vidhu

Upvotes: 4

Views: 1849

Answers (2)

ghoti
ghoti

Reputation: 46816

Your hosting provider seems to be capturing outbound SMTP requests and forwarding them to their own SMTP server.

Are you connecting to Google on port 25? Instead, connect on port 587, the SMTP submission port. If you're already using 587, and your hosting provider is capturing THIS traffic, then send them a very nasty email threatening to switch hosting providers if they don't stop interfering with your web application immediately. This sort of BS may be tolerated by residential dial-up and DSL subscribers, but it's wholly inappropriate for web hosting and co-location.

If your provider is on the ball, they'll apologize and point you to the section in their terms and conditions that states that outbound SMTP traffic will now be automatically redirected until a removal request is placed via a support ticket.

Oh, and by the way, your new hosting provider has now captured the authentication credentials with which you authenticate with Google. Time to change passwords and implement TLS, though as far as I'm aware, TLS isn't supported by phpMailer.

Perhaps it's time to look at Swiftmailer or a commercial provider like Postmark ?

Upvotes: 2

fenz kurol
fenz kurol

Reputation: 113

from what i see, i think you must check did you already put the correct SMTP of google (usually: smtp.gmail.com)? and to using google smtp, it's required an authentication like user and password from your google account.

Upvotes: -1

Related Questions