Gmail SMTP Problem

I have a problem sending email using gmail smtp server

Let me explain my situation. 1 week ago I could send emails using php using smtp. Yesterday, my host moved his sites, including mine, to another server. After that I can not send emails. I tested the email scripts on my local machine and it worked fine.

I am currently using phpmailer to send emails. When an error occurred, I turned on debugging on a php script. I launched the debug permission version on the remote web server and on my local machine.

Here is the result: Local computer (running)

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 (not working)

 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 carefully. On my local machine, it looks like there is a gox mx-server address in the debug information, but on the remote computer it has information about hosting providers. I don’t know if this is normal or not. I'm completely wordless

Could you help me or let me know what is wrong?

thanks, Vidh

+4
source share
2 answers

Your hosting provider seems to capture outgoing SMTP requests and redirect them to its own SMTP server.

Are you connecting to Google on port 25? Instead, connect to port 587, the SMTP send port . If you are already using 587 and your hosting provider is capturing this traffic, send them a very nasty email that threatens to switch to hosting providers if they do not stop interfering with your web application immediately. This kind of BS can be allowed by dial-up and DSL subscribers, but this is completely inappropriate for web hosting and co-hosting.

If your provider is on the ball, they will apologize and point you to a section in their terms and conditions, which states that outgoing SMTP traffic will now be automatically redirected until the deletion request is sent via a support ticket.

Oh, and by the way, your new hosting provider has now captured authentication credentials with which you authenticate with Google. It's time to change passwords and implement TLS, although as far as I know, TLS is not supported by phpMailer.

Maybe it's time to see a Swiftmailer or a commercial vendor like Postmark ?

+2
source

from what I see, I think you should check if you have already installed the correct Google SMTP (usually: smtp.gmail.com)? and using google smtp requires an account, such as the user and password from your google account.

-1
source

Source: https://habr.com/ru/post/1440185/


All Articles