954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

sending mail from home servers [localhost]

Hi there,

I have recently installed Apache and PHP on my PC and am trying to run it as a testing server.

After creating a PHP mail() script I receive the following error in my Apache log file:

"PHP Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.localhost.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\send.php on line 8"

I later discovered that i need a SMTP server. I replaced 'smtp.localhost.com' in my php.ini file with smtp.gmail.com but it still does not work, returning the error:

"PHP Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. p10sm177365gvf.7 in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\send.php on line 8"

Could anyone let me know how to resolve this problem?

I just want to test my PHP mail scripts on my own computer regardless of whether it is online or offline.

Thank you for your support!

jaca123
Newbie Poster
3 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

i don't know if this might help anybody:

; For Win32 only.
SMTP = smtp.gmail.com
smtp_port = 25

; For Win32 only.
;sendmail_from = [email]me@localhost.com[/email]

It is from my PHP.ini file

jaca123
Newbie Poster
3 posts since Jun 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You