RE: php email question
| From: | Rick Emery | Date: | Mon, 25 Feb 2002 16:07:27 +0000 |
| Subject: | RE: php email question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-86106@lists.php.net to get a copy of this message | ||
Terry: I forwarded this to php-general list. Perhaps they can answer your
question
-----Original Message-----
From: Terry Romine [mailto:eatrom@blazing-trails.com]
Sent: Monday, February 25, 2002 10:01 AM
To:
Subject: php email question
I am trying to set up a MIME email that would include an HTML and Plain
Text version of content, such that if the recipient's email client did
not understand html or have html disabled, that the content would come
through as plain text, but if html were accepted, the plain text would
be ignored so that it did not show as duplication.
What I have currently works good for the html but the plain text shows
up as well. The mail class is from PROFESSIONAL PHP PROGRAMMING.
Snippet of code is:
include("include/plain.inc"); // the plain text version --
returns $body
include("include/format.inc"); // html version -- returns
$data
$subject = "";
$to = "terry@jumpinteractive.com";
$from = "adfarm";
// create an instance
$mail = new mime_mail;
$mail->from = $from;
$mail->to = $to;
$mail->subject = $subject;
$mail->body = "";
$content_type="text/html; charset=us-ascii";
$mail->add_attachment($data, "", $content_type);
$content_type="text/plain";
$mail->add_attachment($body, "", $content_type);
$mail->send();
echo("<h2>Newsletter has been sent.</h2>");
Thanks in advance.
Terry