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() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at &quot;smtp.localhost.com&quot; port 25, verify your &quot;SMTP&quot; and &quot;smtp_port&quot; 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() [<a href='function.mail'>function.mail</a>]: 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!

i don't know if this might help anybody:

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

; For Win32 only.
;sendmail_from = me@localhost.com

It is from my PHP.ini file

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.