Simple mail question

the mail() function

Moderators: macek, egami, gesf

Post Reply
rupali
New php-forum User
New php-forum User
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA

Re: Simple mail question

Post by rupali » Fri Feb 03, 2012 6:50 pm

try this way,

<?php
if ( isset($_POST[ 'buttonPressed' ]))
{
$to = 'wherever' ;
$subject = 'From PHP contact page' ;
$message = $_POST[ "message" ];
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: ' . $_POST [ "from" ] . PHP_EOL ;
mail($to,$subject,$message,$headers);
header("Location: wherever");
}
?>

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests