Can't get mail to send...

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Can't get mail to send...

Postby s3rvant » 26. September 2009 11:25

I'm using xampplite on windows xp and I'm having trouble getting the php mail function to actually send mail. I'm not getting any errors, so I suspect it's a setting in php.ini and/or sendmail.ini that I need to fix. I've tried just setting a few things in php.ini to no avail and I've also tried setting up sendmail.ini to work through my gmail account, but I'm at a loss there too. I have searched these forums as well as others and tried different settings, but none have worked. Here's what I have currently (note, I'm only posting lines that I have edited from default):

xampplite\apache\bin\php.ini & xampplite\php\php.ini
Code: Select all
extention=php_smtp.dll
sendmail_path = "F:\xampplite\sendmail\sendmail.exe -t"


Yes I have xampplite on F:

xampplite\sendmail\sendmail.ini
Code: Select all
smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=auto
default_domain=gmail.com
auth_usernam=myusername@gmail.com
auth_password=mypassword
pop3_server=pop.gmail.com
pop3_username=myusername@gmail.com
pop3_password=mypassword


For the gmail settings I have also tried the port 587, and originally didn't have the pop3 settings specified as I don't believe gmail requires them, but I wanted to rule that out. I would prefer to not need to send through gmail as I need to use a business email address in the final product, but getting this to work for now would be a great starting point. Any help would be very much appreciated.
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 12:14

s3rvant wrote:For the gmail settings I have also tried the port 587,


Why?

From http://mail.google.com/support/bin/answ ... swer=86400

Servername: smtp.googlemail.com
Port: 25
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby s3rvant » 26. September 2009 12:22

Because I originally went through the outlook 2007 guide just cause it's the first thing I clicked and it says:
13. In the Outgoing server (SMTP) box, enter 587


also note that even in the thunderbird guide that you linked it says:
Port: 25 (or 587)


Please note that 25 is the default value and obviously it didn't work. Any other ideas?
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 12:34

s3rvant wrote:also note that even in the thunderbird guide that you linked it says:
Port: 25 (or 587)


No, not for me. Maybe you get another page (english) due to different browser settings, but on my page it says Port 25 only.

Did you try that?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby s3rvant » 26. September 2009 12:49

Please note that 25 is the default value and obviously it didn't work


I did try it again just to double check, it did not work.
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 12:51

Oops - just found a typo:

auth_usernam=myusername@gmail.com


There is missing an 'e', it must be auth_username
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby s3rvant » 26. September 2009 12:53

Sorry, unfortunately I had typed the different lines of code, so the typo was on the forum only... if only it would be that easy... lol
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 12:57

Did you configure an error_log in sendmail.ini?

Code: Select all
error_logfile=error.log


Maybe you will find a message if sendmail fails.

And try to disable smtp_ssl (set to "None"), as I hardly remember an issue with not proper working ssl/tls. Not sure about that, simply try it.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby s3rvant » 26. September 2009 13:04

Connect timed out.

timed out regardless of ssl
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 13:06

Aha - i found an interesting article about Xampp and sendmail. There IS an issue with ssl, see http://brettshaffer.com/blog/how-to/php ... n-windows/

If you are going to use SSL connections, you will need two additional files, available here (as of March 2009) – if this link no longer works, use the contact form and let me know.

* Extract the two compressed files (libeay32.dll and ssleay32.dll) to the same directory as sendmail.exe (for me, C:\xampp\sendmail\)
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 13:08

s3rvant wrote:Connect timed out.


That typically happens if your firewall does not let you out. You cannot even connect.

Check all your firewalls, security tools etc.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby s3rvant » 26. September 2009 13:14

Current PC I'm using doesn't have an antivirus, only has spybot search & destroy (without the settings protection) and windows firewall disabled. Not sure what else I could turn off?

also downloaded and extracted the two dll's per his instructions, still times out.
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 13:49

s3rvant wrote:Not sure what else I could turn off?


Dont know - sorry, but thats your PC. For a quick check you could download the "Advanced Port Scanner" from www.radmin.com and check the desired ports (25, 465, 587) from smtp.gmail.com (72.14.221.109) and smtp.googlemail.com (72.14.221.16).

You could also run a little PHP script which contains a fsockopen() to the smtp servers, in order to see if it also times out.

s3rvant wrote:also downloaded and extracted the two dll's per his instructions, still times out.


As long as you have no connection to the SMTP Servers, there is no need for any extras. You must find out, why you (your Apache/PHP) cannot reach the SMTP Server.

Did you try to configure a standard email client to use Google Mail?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Can't get mail to send...

Postby s3rvant » 26. September 2009 14:03

Ran the scanner, it showed all 3 ports open to both IP's. I've had thunderbird in the past, but prefer the web interface, so the pc can definitely connect.

Btw, I started this testing on my work pc, I'm home now with full xampp and having the same issue, so it's not just one pc.
s3rvant
 
Posts: 14
Joined: 26. September 2009 11:10

Re: Can't get mail to send...

Postby Nobbie » 26. September 2009 14:26

Try to use Mercury SMTP Relay insteadof sendmail.exe. It's a bit harder to configure, but probably less buggy.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 91 guests