Re: mail() sending in html format (or not)
- From: paul <paul@xxxxxxx>
- Date: Thu, 30 Jun 2005 10:07:27 -0700
steve wrote:
look at the examples found on php.net for the mail() function...you'll need to look at the examples that show sending headers...that should get you the rest of the way.
Ah, now I get it.
$headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: php\n"; $headers .= "From: \"".$fromname."\" <".$fromaddress.">\n";
mail($toaddress, $subject, $message, $headers);
So I'll need to separate headers and message. I'm not sure how it would reassemble that though as multi-part. Maybe if I just did a simpler html only content with one header.
if you have access to you smtp server's pick up directory, i'd recommend just writing directly to it with the output.
I'll check. I'm not sure how this would help though.
imho, php has always had weak support for sending email...especially where authentication is concerned. this approach takes a lot of guess work out of the picture. at this point, you be troubleshooting your own pertanent code...get that working and then you could play around with how you want/should be sending the mail based on other constraints you may be under.
Well, I tried it with just one header and I think it's working. Mozilla doesn't really show the html styling but I think that's just following the default display without adding colors & such. When I reply, it shows up as an html table.
For the record, this is what I used (very bare bones):
<?
function html_mail()
{
global $emailTo;
global $emailCC;
$html = '
<html>
<style>
</style>
<body>
'; $html .= '<table>';
$html .= '<tr><td>';
$html .= "column 1";
$html .= '</td>'
. "\r\n";
$html .= '<td>';
$html .= "column 2";
$html .= '</td></tr></table>'
. "\r\n";
$html .= "testing, does the above appear as a table to you
or plain text?
</body>
</html>
";
$mail = "MIME-Version: 1.0\r\n";
$mail .= "FROM: Automated Email <info@xxxxx>\r\n";
$mail .= "Subject: Triteleia Order Confirmation \r\n";
$mail .= "Content-Type: text/html; charset=us-ascii\r\n";
$mail .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
mail($emailTo, "", $html, $mail);
}
$emailTo = "info@xxxxx";
html_mail()
?>.
- Follow-Ups:
- Re: mail() sending in html format (or not)
- From: steve
- Re: mail() sending in html format (or not)
- References:
- mail() sending in html format (or not)
- From: paul
- Re: mail() sending in html format (or not)
- From: steve
- Re: mail() sending in html format (or not)
- From: paul
- Re: mail() sending in html format (or not)
- From: steve
- Re: mail() sending in html format (or not)
- From: paul
- Re: mail() sending in html format (or not)
- From: paul
- Re: mail() sending in html format (or not)
- From: steve
- mail() sending in html format (or not)
- Prev by Date: Re: Custom Template-Style Tags
- Next by Date: Re: mail() sending in html format (or not)
- Previous by thread: Re: mail() sending in html format (or not)
- Next by thread: Re: mail() sending in html format (or not)
- Index(es):
Relevant Pages
|