|
|
|
|
|
|
![]() |
#1 | |
Shift Out / X-On
|
sending email from php with html format
$message gets content from textarea and it looks like this
Quote:
Code:
<?php $mailTo = $_POST['emailTo']; $mailFrom = $_POST['emailFrom\r\n']; $subject = $_POST['subject']; $message = $_POST['message']; /* To send HTML mail, you can set the Content-type header. */ $headers = "From: emailFrom\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($mailTo, $subject, $message, "From: ".$mailFrom, $headers); ?> |
|
![]() |
![]() |
![]() |
#2 |
Shift Out / X-On
|
Well, I had it almost right, following solution works perfect
![]() Code:
<?php $mailTo = $_POST['emailTo']; $mailFrom = $_POST['emailFrom\r\n']; $subject = $_POST['subject']; $message = $_POST['message']; /* To send HTML mail, you can set the Content-type header. */ $headers = "From: emailFrom\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($mailTo, $subject, $message, $headers, "From: ".$mailFrom); ?> Last edited by pc; 2011-02-25 at 09:41 PM.. |
![]() |
![]() |
![]() |
|
|