Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 8th, 2006, 09:45 AM
monomaniac21
Guest
 
Posts: n/a
Default how to send a plain text version of an email with html

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

  #2  
Old August 8th, 2006, 09:45 AM
Erwin Moller
Guest
 
Posts: n/a
Default 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
  #3  
Old August 8th, 2006, 09:55 AM
monomaniac21
Guest
 
Posts: n/a
Default 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
  #4  
Old August 8th, 2006, 10:45 AM
Rik
Guest
 
Posts: n/a
Default 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


  #5  
Old August 8th, 2006, 12:15 PM
Kenneth Downs
Guest
 
Posts: n/a
Default 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)
  #6  
Old August 8th, 2006, 08:45 PM
Chuck Anderson
Guest
 
Posts: n/a
Default 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
*****************************
  #7  
Old August 9th, 2006, 07:15 PM
monomaniac21
Guest
 
Posts: n/a
Default 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
*****************************
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles