Advertisement:

Author Topic: Anybody having recent issues with gmail?  (Read 1079 times)

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Anybody having recent issues with gmail?
« on: January 03, 2018, 10:25:06 AM »
I just can't get my G-Suite account to work with SMF.

I did both the edits to Sources/Subs-Posts.php and entered ssl://smtp.gmail.com with port 465 and the right mail address and password.
On top of hat I went into my G-Suite account en enabled to use less secure apps, but still no dice.
I'm testing this by going to members waiting for activation and sending reminders to an account I own.

Is there anyone that can help?
I really need this to work, the forum is going live soon and I definitely want to be using the Gmail-servers at that moment.

Offline Shambles

  • SMF Hero
  • ******
  • Posts: 4,570
  • Gender: Male
    • i30 Owners Club
Re: Anybody having recent issues with gmail?
« Reply #1 on: January 03, 2018, 10:41:35 AM »
Anything mail-related in your forum error log?

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #2 on: January 03, 2018, 11:02:17 AM »
Nothing that I can see (though the forum seems to generate a awful lot of errors, but that's for another thread, I guess).

Is the way I'm testing if the mail is working the right way?
(going to a specific member waiting for activation, and sending reminders)

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Anybody having recent issues with gmail?
« Reply #3 on: January 04, 2018, 09:07:08 AM »
How about trying to send a newsletter to yourself? To the same address you are trying to use as the sender. That would at least tell you if you are able to get it to reach gmail in the first place.
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline SaltedWeb

  • Sr. Member
  • ****
  • Posts: 729
  • Why do we use the Internet...Hayes 1200 Thats Why
Re: Anybody having recent issues with gmail?
« Reply #4 on: January 04, 2018, 01:15:41 PM »
My own personal experiences with SMF, is   Gmail doens't play well with forums. And that Godaddy hosting doesn't play well with SMF.
Not that they are related but seems on the topics of errors people tend to have more problems with Gmail and Godaddy as causes for their problem.  I see you really want to use Gmail, but I can say using it in the past I had some very crucial emails going thru SMF that did not reach the people it should and it ended up costing me allot of money. I personally do not find it reliable to use of a forum because of its known spotty service this is not just SMF I had same issues with paid forum software like Xenforo.  Just throwing it out there as a side note to think about.
Multi-Linking, like a Boss.

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Anybody having recent issues with gmail?
« Reply #5 on: January 04, 2018, 04:41:47 PM »
I personally do not find it reliable to use of a forum because of its known spotty service this is not just SMF I had same issues with paid forum software like Xenforo.  Just throwing it out there as a side note to think about.
It's not about the script sending the mails, it's about the server handling them really.
And a lot of other variables, like domains and receiving mail services, and spam filters and so on...
Forums can send out mail perfectly to large audiences, if everything works.
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #6 on: January 05, 2018, 07:36:07 AM »
How about trying to send a newsletter to yourself? To the same address you are trying to use as the sender. That would at least tell you if you are able to get it to reach gmail in the first place.

Tried this, no dice.
So I went back to the mail-options I had earlier (not Google, from the provider) and newsletters still don't get sent (I get a Gateway Timeout).

I'm trying to find if there are errors in the logs that point to the problem, but how do I recognise errors that are related to problems with the mail-function?

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #8 on: January 05, 2018, 08:12:38 AM »
@ Aleksi: didn't know about this script, thanks for pointing me to it!

Just tried it and it worked on both sides!!
So I guess this means that the mail is working, but the Newsletter isn't.

I'll test the same script with the settings for Gmail, would be nice if that would work as well
(though I understand Gmail and SMF often don't really 'like' each other much).

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Anybody having recent issues with gmail?
« Reply #9 on: January 05, 2018, 08:23:59 AM »
That tells us that your server can send mail, and the PHP option should work at least.
Then the next step would be to try and find out why the SMTP options you are using do not work.
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #10 on: January 05, 2018, 08:28:24 AM »
That tells us that your server can send mail, and the PHP option should work at least.

So some good news, but not good news all around, yes?

Quote
Then the next step would be to try and find out why the SMTP options you are using do not work.

Do you know how I can test this?

By the way, I just changed the settings to Gmail and again, success on both sides! :D

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Anybody having recent issues with gmail?
« Reply #11 on: January 05, 2018, 09:23:41 AM »
No good ideas from me really, apart from what you yourself already mentioned - it should probably leave something in your logs when failing. I have never really tried to get gmail to work, as I have always found it easier to just create a local domain address and use the PHP mail functionality.
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline Jailer

  • Jr. Member
  • **
  • Posts: 109
  • Gender: Male
    • Bored Guy Blog
Re: Anybody having recent issues with gmail?
« Reply #12 on: January 05, 2018, 05:12:48 PM »
I gave up on gmail a while ago and went with mailgun. Haven't had any issues since.

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #13 on: January 05, 2018, 05:48:02 PM »
Still trying to understand this, which leads me to the following question:

if the PHP-test worked with Gmail, can't I just choose PHP-mail instead of SMTP-mail in the Email-setting?

Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Anybody having recent issues with gmail?
« Reply #14 on: January 05, 2018, 06:13:56 PM »
You could, but that could end up causing more trouble since, as I understand it, you would be effectively forging the sender address. When you use that option, it is not actually sent through gmail.
Finnish Native Language Support Specialist & Former (Lead) Support Specialist

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #15 on: January 05, 2018, 06:19:13 PM »
When you use that option, it is not actually sent through gmail.

Hmm, so definitely not an option, not looking for forging anything of course.

Guess making sure that the SMTP option works is the only valid option...

Offline Illori

  • Project Manager
  • SMF Master
  • *
  • Posts: 48,337
Re: Anybody having recent issues with gmail?
« Reply #16 on: January 05, 2018, 06:22:43 PM »
if you use the php mail option to SEND to a gmail address using an email address that is on your domain there is no issue. if you want to SEND from a gmail address then you need to set up smtp.

Offline Dwev

  • Jr. Member
  • **
  • Posts: 103
Re: Anybody having recent issues with gmail?
« Reply #17 on: January 05, 2018, 07:17:34 PM »
if you want to SEND from a gmail address then you need to set up smtp.

That's the option that I want to get to work.

Would be great if there was an easy option to check if it works (like with the PHP-script).

Offline tinoest

  • Development Contributor
  • Jr. Member
  • *
  • Posts: 195
Re: Anybody having recent issues with gmail?
« Reply #18 on: January 07, 2018, 12:55:14 PM »
I think you need to apply the changes I made to SMF2.1 for Gmail to work.

So go to Subs-Post.php and add this to the start of the smtp_mail function.


Code: [Select]
if (function_exists('gethostname') && gethostname() !== false)
  $helo = gethostname();
elseif (function_exists('php_uname'))
  $helo = php_uname('n');
elseif (array_key_exists('SERVER_NAME',$_SERVER) && !empty($_SERVER['SERVER_NAME']))
  $helo = $_SERVER['SERVER_NAME'];
 
if (empty($helo))
  $helo = $modSettings['smtp_host'];

Then find this

Code: [Select]
if (server_parse('EHLO ' . $modSettings['smtp_host'], $socket, null) == '250')
And replace with

Code: [Select]
if (server_parse('EHLO ' . $helo, $socket, null) == '250')
You might also need to add this after the above if statement.

Code: [Select]
// Send STARTTLS to enable encryption
if (!server_parse('STARTTLS', $socket, '220'))
return false;
// Enable the encryption
if (!@stream_socket_enable_crypto($socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT))
return false;
// Send the EHLO command again
if (!server_parse('EHLO ' . $helo, $socket, null) == '250')
return false;




Online Aleksi "Lex" Kilpinen

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,887
  • Gender: Male
  • The Artist Formerly Known as LexArma
    • Aleksi.Kilpinen on Facebook
    • aleksi-kilpinen on LinkedIn
Re: Anybody having recent issues with gmail?
« Reply #19 on: January 08, 2018, 05:18:18 AM »
I think you need to apply the changes I made to SMF2.1 for Gmail to work.
Thank's - This I guess is due to Gmail being picky about the connections then :)
Finnish Native Language Support Specialist & Former (Lead) Support Specialist