i have tried to send email from localhost in WAMP server but it shows me this error:
mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
i have edited the php.ini file like:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
my php file code is :
$to = '$rowemail["email"]';
$subject = 'Testing sendmail.exe';
$message = 'Hi, you just received an email using sendmail!';
$headers = 'From: [memarez@gmail.com' . "\r\n" .
'MIME-Version: 1.0' . "\r\n" .
'Content-type: text/html; charset=utf-8';
if(mail($to, $subject, $message, $headers))
echo "Email sent";
else
echo "Email sending failed";