<?php

$to='gsankar5181@gmail.com';
$message='hai';
$sen=mail($to, 'My Subject', $message);
if($sen)
echo "yes";
else
echo "no";

?>
14-04-04 14:35:44 : Message is missing sender's address
14-04-04 14:39:37 : Message is missing sender's address
14-04-04 14:39:39 : Message is missing sender's address

$headers = 'From: webmaster@example.com' . "\r\n";
$sen=mail($to, 'My Subject', $message,$headers);

Sending Email

$message="Hello ".$_POST['fname'].",<br>

First name:".$_POST['fname']."<br>

Last name:".$_POST['lname']."<br>

Email:".$_POST['email']."<br>

Phone number:".$_POST['phone']."<br>

Subject:".$_POST['subject']."<br>

Message:".$_POST['message']."<br>

Thanks.<br><br>

Regards,

";

$sub = "Contact User";

$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

@mail("XYZ@gmail.com",$sub,$message,$headers);


$message1="Thank you for your conact";


$headers = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

@mail($_POST['email'],$sub,$message1,$headers);

$to='gsankar5181@gmail.com';
$subject = 'My Subject';
$email = 'xyz@xyz.com' ;
$headers = 'From:$email';

$message='hai';
$sen=mail($to,$subject, $message,$headers);
if($sen)
echo "yes";
else
echo "no";

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.