Hi
I wanted help with the php mail().
I am working on a little helpdesk program, and I want it to send to the users when submit requests, and notifications, but I cant pass html into the mail(), and I wanted to know what the correct way of doing this is.
Thanks
Here is the code
mail("".$worker_email_address."", "job#".$jobno."", $msg_worker,"From: $email\r\n"); }
$worker_email_address= the persons email
$jobno = the number of the job
$msg_worker = the message
$email = my email
Thanks
PHP mail()using html
Moderator: General Moderators
-
bond0bhave
- Forum Newbie
- Posts: 5
- Joined: Wed May 29, 2002 1:55 am
- Location: Durban, South Africa
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
To send HTML e-mail you need to add extra headers to the message.
Taken directly from the manual (http://www.php.net/manual/en/function.mail.php):
So in your case you would need to have:
Hope this helps,
Mac
Taken directly from the manual (http://www.php.net/manual/en/function.mail.php):
Code: Select all
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: Birthday Reminder <birthday@example.com>\r\n";Code: Select all
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $email\r\n";
mail($worker_email_address, 'job#'.$jobno, $msg_worker, $headers);Mac
-
bond0bhave
- Forum Newbie
- Posts: 5
- Joined: Wed May 29, 2002 1:55 am
- Location: Durban, South Africa