1

In php.ini I set:

SMTP = smtp.gmail.com
smtp_port = 465

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = mygmail@gmail.com

In my sendmail.ini:

smtp_server=smtp.gmail.com
smtp_ssl=ssl
auth_username=mygmail@gmail.com
auth_password=mygmail password

In my error log:

13/05/18 23:33:30 : Socket Error # 10060<EOL>Connection timed out.

The email actually sent twice, but 99% of the time, I get the same error as above. I disabled my router's SPI, and my computer's firewall. Any ideas?

user2316667
  • 5,444
  • 13
  • 49
  • 71

1 Answers1

4

Most local boxes with Windows don't come with a SMTP server. You could use an external SMTP server and configure it in your php.ini file, but SMTP authentication is not possible.

I recommend you to use PHPMailer, is a simple and flexible PHP Class, that can use a SMTP server with authentication. It is also more secure than using bundled PHP mail() function.

http://phpmailer.worxware.com/

Marcelo Pascual
  • 810
  • 8
  • 20
  • Marcelo, I really appreciate your response. What do you mean by 'external' SMTP server? Do you mean one I am not hosting? Why isn't SMTP authentication not possible? Isn't authentication simple using a password to access the server? Don't google mail servers use authentication? Also, with PHPMailer is just something that makes it easier to send emails. I still need the server! Please read the edits above. I am attempting to use google's servers but it is not working out. – user2316667 May 18 '13 at 03:33
  • I don't have experience setting up sendmail in Win, it seems that SMTP authentication is possible. I was talking for what I see in a standard `php.ini` file, in `[mail function]` section, there is no SMTP auth there. In any case, you should look to your error logs to see what's happening. By 'external SMTP server' I was refering to, for example, Gmail servers. With Gmail, also try 'tls' for your `smtp_ssl` config value. – Marcelo Pascual May 18 '13 at 16:52