Saturday, 31 August 2013

php can't send email

php can't send email

I have been trying to send a php contact form, but it's not working at
all. my xampp use 8080 port.
I though that I have to change some configuration on php.ini or httpd.conf
as well.
Please anybody help me.
Thank you.
this is the script:
<?php
$to = "tiya.vort4@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = 'From: '.$from."\r\n".
'Reply-To: '.$from."\r\n" .
'X-Mailer: PHP/' . phpversion();
if(mail($to,$subject,$message,$headers)){
echo "Mail Sent.";
}

No comments:

Post a Comment