Eustace wrote:
I am relatively new to PHP and could use some help. I have a form, which is
basically in an email format, from, subject, and message. How do I then send
this to an email? I know a bit about the mail function, somebody show me the
ropes please!
Eustace
I'll show you how we do it here at work, its quite simple:
//Target message setup
$target_receptemail = 'insert email here';
$target_receptname = 'insert the targets name here';
$target_senderemail = 'insert your email here';
$target_sendername = 'insert your name here';
//Message body setup
//Target setup
$target_bodymsg = 'Insert content here';
$target_subjectmsg = 'Insert subject here';
//Build the headers
$headers = array(
'From: '.$target_sendername.' <'.$target_senderemail.'>',
'Content-Type: text/html'
);
//Send the mail
mail(
$target_receptemail,
$target_subjectmsg,
$target_bodymsg,
implode("\r\n", $headers)
);
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php