send mail is not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manish812
Forum Newbie
Posts: 1
Joined: Fri Aug 20, 2010 10:12 am

send mail is not working

Post 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 :(
Post Reply