Mail function wont send eMail. ERROR
Posted
by
Peter
on Stack Overflow
See other posts from Stack Overflow
or by Peter
Published on 2013-06-30T16:18:35Z
Indexed on
2013/06/30
16:21 UTC
Read the original article
Hit count: 237
I think i tried to fix this issue fr 3 days now and cant seem to find the problem.
I use XAMPP and use this code:
<?php
$to = "[email protected]";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "[email protected]";
$headers = "From: $from";
$res= mail($to,$subject,$message,$headers);
echo " $res Mail Sent.";
?>
when i enter that page i get an error that says:
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set(
My php.init file in xampp are as follow:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smpt.gmail.com
; http://php.net/smtp-port
smtp_port = 25
That is all my codes.
© Stack Overflow or respective owner