Re: http webmail problems.
| From: | Tom Reed | Date: | Wed, 24 Mar 2004 21:41:20 +0000 |
| Subject: | Re: http webmail problems. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181395@lists.php.net to get a copy of this message | ||
thanks for the FYI on PEAR, installing now.
I'd still be interested in understanding why the header data in my code
didn't work.
-tom
"Justin Patrin" <papercrane@reversefold.com> wrote in message
news:20040323212634.95177.qmail@pb1.pair.com...
> Tom Reed wrote:
>
> > On some webmail programs, when I send them an email from php, they
appear as
> > being "blank" emails.
> >
> > Here's the code I am using:
> >
> > $headers .= "From: \"$WEBSITE_name\" <$ADMIN_email>\n";
> > $headers .= "X-Sender: <$ADMIN_email>\n";
> > $headers .= "X-Mailer: $WEBSITE_name Mailer\n"; // mailer
> > $headers .= "X-Priority: 1\n"; // Urgent message!
> > $headers .= "Return-Path: <$ADMIN_email>\n"; // Return path for
errors
> >
> > $headers .= "MIME-version: 1.0\n";
> > $headers .= "Content-type: multipart/mixed; ";
> > $headers .= "boundary=\"Message-Boundary\"\n";
> > $headers .= "Content-transfer-encoding: 7BIT\n";
> >
> > $message = "--Message-Boundary\n";
> > $message .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime
type
> > $message .= "Content-transfer-encoding: 7BIT\n";
> > $message .= "Content-description: Mail message body\n\n";
> >
> > $message .= "<b>Test message with html</b>";
> >
> > mail($email, "Test HTML message.", $message, $headers);
>
> Try using PEAR's Mail_MIME class. It will do this kind of thing for you.
> http://pear.php.net/package/Mail_MIME
>
> --
> paperCrane <Justin Patrin>