Hi, I’m new to InfinityFree - Thank you for providing this free service. I plan to use it for several low traffic domains that I own. My question is about using an external SMTP service for sending mail from my website. I’ve added Gmail SMTP Gmail SMTP – WordPress plugin | WordPress.org to some other sites I run, and never had a problem. For some reason, after I add and configure it on my Infinity site, the test mail isn’t sending. Can you shed any light on this? What SMTP port should I select? 587 is the recommended for TLS encryption. Thanks for any assistance you can provide.
Are you using Gmail’s SMTP servers to send the e-mail? If so, is the From address of your e-mail a Gmail address too? If not, then Google is probably rejecting your message because you’re trying to send from an address which isn’t yours. Try to send your message from the Gmail address instead.
The port number is absolutely fine though.
Yes, using the plugin, you create an OAuth connection, specify the OAuth email address, then the from email address you want the email to be from, type of encryption (TLS or SSL) and the port. Here’s the help page on it:
https://wphowto.net/gmail-smtp-plugin-for-wordpress-1341
I tried some of the troubleshooting (different ports) but haven’t had any luck so I was wanting to know if perhaps something at the hosting end is causing the hiccup.
I didn’t even know you could do SMTP authorization with OAuth. However, after the authentication step it seems to be pretty much standard SMTP, and I can’t think of any reason why it would be blocked from our end.
Hmm, that’s not good.
The plugin developer asked me to ask you to make sure that port 587 is open and supports TLS encryption? Can you confirm this?
@MDC208 said:
The plugin developer asked me to ask you to make sure that port 587 is open and supports TLS encryption? Can you confirm this?
Yes, port 587 is open and TLS is supported.
By the way, do you get any error message when sending the email? If the SMTP connection cannot be established or the message is rejected immediately by Gmail, an error message should be returned by the SMTP connection which the plugin could show you. If there is no error message returned by the SMTP connection, then Gmail is throwing the message away probably.
Which From or Sender address are you using for the email?
Here’s what I get when I use the “send test mail” feature. I showed this to the plugin dev and he said that it doesn’t show specifically why the connection was closed.
Also, I’m using an email address associated with my google apps gmail domain (different domain than what I’m using here on this host)
Connection: opening to smtp.gmail.com:587, timeout=300, options=array () Connection: opened SMTP -> get_lines(): $data is "" SMTP -> get_lines(): $str is "220 smtp.gmail.com ESMTP 63sm3776695wmg.22 - gsmtp" SERVER -> CLIENT: 220 smtp.gmail.com ESMTP 63sm3776695wmg.22 - gsmtp CLIENT -> SERVER: EHLO www.xxxxx.com SMTP -> get_lines(): $data is "" SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [185.27.134.36]" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]" SMTP -> get_lines(): $str is "250-SIZE 35882577" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577" SMTP -> get_lines(): $str is "250-8BITMIME" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME" SMTP -> get_lines(): $str is "250-STARTTLS" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-STARTTLS" SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES" SMTP -> get_lines(): $str is "250-PIPELINING" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING" SMTP -> get_lines(): $str is "250-CHUNKING" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING" SMTP -> get_lines(): $str is "250 SMTPUTF8" SERVER -> CLIENT: 250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-STARTTLS250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 CLIENT -> SERVER: STARTTLS SMTP -> get_lines(): $data is "" SMTP -> get_lines(): $str is "220 2.0.0 Ready to start TLS" SERVER -> CLIENT: 220 2.0.0 Ready to start TLS CLIENT -> SERVER: EHLO www.xxxxx.com SMTP -> get_lines(): $data is "" SMTP -> get_lines(): $str is "250-smtp.gmail.com at your service, [185.27.134.36]" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]" SMTP -> get_lines(): $str is "250-SIZE 35882577" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577" SMTP -> get_lines(): $str is "250-8BITMIME" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME" SMTP -> get_lines(): $str is "250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH" SMTP -> get_lines(): $str is "250-ENHANCEDSTATUSCODES" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES" SMTP -> get_lines(): $str is "250-PIPELINING" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING" SMTP -> get_lines(): $str is "250-CHUNKING" SMTP -> get_lines(): $data is "250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING" SMTP -> get_lines(): $str is "250 SMTPUTF8" SERVER -> CLIENT: 250-smtp.gmail.com at your service, [185.27.134.36]250-SIZE 35882577250-8BITMIME250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-PIPELINING250-CHUNKING250 SMTPUTF8 Auth method requested: XOAUTH2 Auth methods available on the server: LOGIN,PLAIN,XOAUTH2,PLAIN-CLIENTTOKEN,OAUTHBEARER,XOAUTH CLIENT -> SERVER: QUIT SMTP -> get_lines(): $data is "" SMTP -> get_lines(): $str is "221 2.0.0 closing connection 63sm3776695wmg.22 - gsmtp" SERVER -> CLIENT: 221 2.0.0 closing connection 63sm3776695wmg.22 - gsmtp Connection: closed
Well, I agree with the plugin developer that it doesn’t show why the connection was closed. However, the CLIENT -> SERVER: QUIT
line suggests that the script is closing the connection. Again, why it happens, I don’t know, but I can’t think of any reason I can do something about it from my end.
Could you try using the regular SMTP connector from Wordpress to send your messages using Gmail? That could help rule out any plugin issues.
Sure thing, I’ll give it a go with another SMTP plugin. Only reason I used this one, and use it on other sites is because it’s specifically for Gmail, but your idea is good for troubleshooting so I will try too. Will update later.
To be clear, you mean this plugin?
Tried the plugin linked in my last post and it worked on the very first try. Problem solved - thank you!