Connecting Tech Pros Worldwide Forums | Help | Site Map

how to send a plain text version of an email with html

monomaniac21
Guest
 
Posts: n/a
#1: Aug 8 '06
hi all

how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?

kind regards

marc


Erwin Moller
Guest
 
Posts: n/a
#2: Aug 8 '06

re: how to send a plain text version of an email with html


monomaniac21 wrote:
Quote:
hi all
>
how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?
>
kind regards
>
marc
Simple: Make 2 versions.

Or if you want to do it the very hard way: try to strip all html-tags.

Regards,
Erwin Moller
monomaniac21
Guest
 
Posts: n/a
#3: Aug 8 '06

re: how to send a plain text version of an email with html


Hi Erwin

How does the email client know where the plain text version is located?

Regards

Marc

Erwin Moller wrote:
Quote:
monomaniac21 wrote:
>
Quote:
hi all

how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?

kind regards

marc
>
Simple: Make 2 versions.
>
Or if you want to do it the very hard way: try to strip all html-tags.
>
Regards,
Erwin Moller
Rik
Guest
 
Posts: n/a
#4: Aug 8 '06

re: how to send a plain text version of an email with html


monomaniac21 wrote:
Quote:
Erwin Moller wrote:
Quote:
>monomaniac21 wrote:
>>
Quote:
>>hi all
>>>
>>how can u send a plain text version of an email with the html so
>>that the users mail client can access this plain text version?
>>>
>>kind regards
>>>
>>marc
>>
>Simple: Make 2 versions.
>>
>Or if you want to do it the very hard way: try to strip all
>html-tags.
>>
How does the email client know where the plain text version is
located?
In a multipart email 2 versions are usually sent: the text en the HTML part.

headers:
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="some_random_string";

before text:
--some_random_string
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

before HTML:
--some_random_string
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Where some_random_string remains the same throughout the mailobviously.
Other charsets are offcourse possible.

Grtz,
--
Rik Wasmus


Kenneth Downs
Guest
 
Posts: n/a
#5: Aug 8 '06

re: how to send a plain text version of an email with html


monomaniac21 wrote:
Quote:
hi all
>
how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?
>
kind regards
>
marc
Do you mean: How to send an email with an html part and a plaintext part, so
that the mail client reads the appropriate version?

This is not easy, but there are PEAR packages that make it about as easy as
it can ever get. Start with PEAR Mail_Mime and PEAR Mail.

--
Kenneth Downs
Secure Data Software, Inc.
(Ken)nneth@(Sec)ure(Dat)a(.com)
Chuck Anderson
Guest
 
Posts: n/a
#6: Aug 8 '06

re: how to send a plain text version of an email with html


monomaniac21 wrote:
Quote:
hi all
>
how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?
>
kind regards
>
marc
>
>
Phpmailer makes this easy. You need to create both versions - HTML and
plain text and then ...

$mail->IsHTML(true); // set email format to HTML

$mail->Body = "$html_body"; // HTML version
$mail->AltBody = "$text_body"; // plain text version

Phpmailer is easy to find >Gô¿ôgle

--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
*****************************
monomaniac21
Guest
 
Posts: n/a
#7: Aug 9 '06

re: how to send a plain text version of an email with html


Thanks Chuck

Nice site btw

Chuck Anderson wrote:
Quote:
monomaniac21 wrote:
Quote:
hi all

how can u send a plain text version of an email with the html so that
the users mail client can access this plain text version?

kind regards

marc
Phpmailer makes this easy. You need to create both versions - HTML and
plain text and then ...
>
$mail->IsHTML(true); // set email format to HTML
>
$mail->Body = "$html_body"; // HTML version
$mail->AltBody = "$text_body"; // plain text version
>
Phpmailer is easy to find >Gô¿ôgle
>
--
*****************************
Chuck Anderson · Boulder, CO
http://www.CycleTourist.com
*****************************
Closed Thread