Page 1 of 1

send mail is not working

Posted: Fri Aug 20, 2010 10:19 am
by manish812
Hi all

I'm new to PHP.

I want to send email from php. Simple mail.

my smtp setting is as http://184.73.234.224/test.php

In my view my smtp setting is not correct so that my mail is not going.

my php code is

Code: Select all

<?php
$from_name = "Gar";
$from_email = "gar@sify.com";
$subject = "testing mail";
$contents = "Hello how r u.";

$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=windows-874\n";
$headers .= "From: ".$from_name."<".$from_email.">\n";
$headers .= "Reply-To: ".$from_email."\r\n";

$mail_sent = mail("manish8n@yahoo.co.in",$subject,$contents, $headers);

echo $a = $mail_sent ? "Mail sent" : "Mail failed";
error_log($a,0);
?>
Thx in advance :(