ElkArte Community

Project Support => Support => Topic started by: ahrasis on June 20, 2016, 01:57:03 pm

Title: Possible Gmail Fix
Post by: ahrasis on June 20, 2016, 01:57:03 pm
I can't get my php to send email from my forum due to my server setup so I'll be needing to send email via gmail instead. Unfortunately, I can't get it working either until I digged into this:
Quote from: http://www.simplemachines.org/community/index.php?topic=544856.msg3870010#msg3870010Ok I have found a resolution to this problem, which requires a minor code change.

The clue was in this post here:

EHLO invalid argument in ssmtp (http://stackoverflow.com/questions/36323790/ssmtp-no-longer-works-invalid-response-501-5-5-4-helo-ehlo-argument-myemaila)

What I've done is edit Sources/Subs-Post.php as follows:

		// EHLO could be understood to mean encrypted hello...
if (server_parse('EHLO ' . $modSettings['smtp_host'], $socket, null) == '250')

Code: (Replace With) [Select]
		// EHLO could be understood to mean encrypted hello...
// if (server_parse('EHLO ' . $modSettings['smtp_host'], $socket, null) == '250')
if (server_parse('EHLO ' . 'localhost', $socket, null) == '250')

All seems to be working now.

Gmail now is working for my forum.

Next, should we fix this in ElkArte?
Title: Re: Possible Gmail Fix
Post by: badmonkey on June 20, 2016, 02:03:34 pm
Interesting!  Does gmail have volume limitations that you're aware? 
Title: Re: Possible Gmail Fix
Post by: ahrasis on June 20, 2016, 02:17:59 pm
They have limits and you can refer them here:

https://support.google.com/a/answer/166852?hl=en

https://support.google.com/a/answer/2956491#sendinglimitsforrelay

I think using gmail in our case is subject to the first one because I think relay is somewhat different (I may be wrong about this :D).
Title: Re: Possible Gmail Fix
Post by: emanuele on June 20, 2016, 03:41:53 pm
http://stackoverflow.com/questions/5294478/significance-of-localhost-in-helo-localhost
https://groups.google.com/forum/#!topic/golang-nuts/Pt_H9d3QVXg

What port are you using?
Try 587.
Title: Re: Possible Gmail Fix
Post by: ahrasis on June 20, 2016, 04:48:21 pm
Tested and that port 587 is definitely not working with default 107 Mail.subs.php or after the suggested fix. Only port 467 is currently working with the suggested fix.