News:

Wondering if this will always be free?  See why free is better.

Main Menu

Forum SMTP

Started by trlacey, March 07, 2014, 10:14:36 AM

Previous topic - Next topic

trlacey

I've been attempting to set the Forum mail settings to smtp.gmail.com.  SMF version 2.0.7 and PHP version 5.5.10.  gmail uses 3 ports.  25, 465 and 587.  They all use TLS and or SSL.  And they all fail.  587 comes back promptly with a loaded SMF page, but the E-Mail is never received.  No error messages on all three ports.  Any suggestions Guys?

trlacey

And please don't ask me if I've set my username and password or checked if the router is plugged in...

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

trlacey

Thanks margarett.  My server is my own server.  I wrote the software.  It implements fastCGI with php-cgi.exe.  The openssl extension is loaded when php-cgi starts.  The server is set to ssl://smtp.gmail.com and port 465 on the router is open.  Sending an e-mail through SMF returns immediately with the correct loaded page.  But no e-mail is ever received.  Odd.

trlacey

Also should mention, running under Windows.

margarett

This is really out my league, I'm moving this to a proper board.

As a suggestion, can you try with a standard *AMP installation? Or maybe create debug routines in your software, dunno...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

trlacey

PHP never returns an error.  But I have written a Mail Server as well.  I'll debug with that and let you know what's going on with the SMTP servers.  As far as what PHP is doing, I'll have to go through their source code.  Don't really have time for this at the moment.  ;)  Thanks for the suggestions.

青山 素子

Have you tried sending mail manually using the same settings on that system? That would be my first step. Second would be to try making a minimal PHP page that sends e-mail using the config you are trying to test. Get SMF out of the way and test the mail function directly. If that works, it's possibly a configuration issue.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


trlacey

Thanks Motoko-chan,

Just experimenting now with PEAR modules.  Does SMF use those?  I doubt it.  Do they use openssl on Windows Servers?  I'll have to take a look at SMF's source as well.  Dealing with source code from several different companies.  I'm not sure whether gmail requires SSL or TLS or gives you the option.  I've implemented both in my web server, but not in my Mail Server yet.  I'll have to do that now.  Another few days worth of work.  I'll figure it out and let you know.

trlacey

Also, sending mail through Outlook on the server is no problem.  Probably not the server configuration.

margarett

You can check this function in Sources/Subs-Post.php
function smtp_mail($mail_to_array, $subject, $message, $headers)

For your tests, be sure to disable mail queue in SMF
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

trlacey

#11
Thanks margarett.  I will.  I'll let you know.  All of these tips are helpful.

trlacey

#12
Oddly it all works now.  The only two differences are that I loaded a few PEAR modules last night and it's now set to yahoo instead of gmail.  I'll do more testing and let you know.

trlacey

#13
Just thought I'd update you with what I've found so far.  Whether the PEAR modules are loaded or not, it doesn't make any difference.  I notice in the Sources/Subs-Post.php code, you're testing the username and password on POP Port 110 of the SMTP server before you connect to port 465.  Your timeout for connecting is set to 3 seconds.  In this case, smtp.gmail.com has no POP server at that address so it times out.  I commented out the POP checking code and bumped up the timeout to connect to the SMTP server Port 465 to 10 seconds.  It all seems to work fine now.

margarett

Thank you for letting us know, it might be a good reference to other people in the future ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

trlacey

Another update.  Using tls://smtp.gmail.com rather than ssl://smtp.gmail.com is faster.  Also, bumping up the server timeout rate for PHP calls to 30 seconds helps.

trlacey

Just thought I'd throw it out there.  ;)

elbeer

Quote from: trlacey on March 09, 2014, 07:43:34 AM
Just thought I'd update you with what I've found so far.  Whether the PEAR modules are loaded or not, it doesn't make any difference.  I notice in the Sources/Subs-Post.php code, you're testing the username and password on POP Port 110 of the SMTP server before you connect to port 465.  Your timeout for connecting is set to 3 seconds.  In this case, smtp.gmail.com has no POP server at that address so it times out.  I commented out the POP checking code and bumped up the timeout to connect to the SMTP server Port 465 to 10 seconds.  It all seems to work fine now.

Could you show the exact code you commented out please as I am having the same issue.

Advertisement: