Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Trouble with simple sendmail.php code

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Trouble with simple sendmail.php code

Postby cutman21 » Mon Dec 24, 2012 1:53 pm

Please, I need help. I'm getting the thank you page, but not the emails from the form. The sendmail.php below:

<?
///mail sending to customer
$subject1="New Contact enquiry";
$to1="myemail@mydomain.com";
$mailcontent1="<html>
<head>
</head>
<body>
<table width='800' border='0' cellspacing='2' cellpadding='0'>
<tr>
<td align='left'>
<p>Hello,</p>
<p><strong><u>Enquiry details as below.</u></strong><br /><br />
<strong>Name: </strong>".stripslashes($_REQUEST['name'])."<br /><br />
<strong>Address: </strong>".stripslashes($_REQUEST['address'])."<br /><br />
<strong>Phone: </strong>".stripslashes($_REQUEST['phone'])."<br /><br />
<strong>Email Address: </strong>".stripslashes($_REQUEST['email'])."<br /><br />
<strong>Message: </strong>".nl2br(stripslashes($_REQUEST['comment']))."<br /><br />
</p>
<p>Thanks</p>
</td>
</tr>
</table>
</body>
</html>
";
//echo $toemail;echo $subject1;echo $mailcontent1;echo $from1;
if($_SERVER['HTTP_HOST']!="yogs")
{
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: ".stripslashes($_REQUEST['email'])." <".stripslashes($_REQUEST['email']).">" . "\r\n";
mail($to1,$subject1,$mailcontent1,$headers);
//mail("myemail@mydomain.com",$subject1,$mailcontent1,$headers);
}
header("location:thankyou.html");
exit;
?>
cutman21
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Dec 21, 2012 6:00 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron