473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Aug 8 '06 #1
6 2106
monomaniac21 wrote:
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
Aug 8 '06 #2
Hi Erwin

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

Regards

Marc

Erwin Moller wrote:
monomaniac21 wrote:
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
Aug 8 '06 #3
Rik
monomaniac21 wrote:
Erwin Moller wrote:
>monomaniac21 wrote:
>>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
Aug 8 '06 #4
monomaniac21 wrote:
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)
Aug 8 '06 #5
monomaniac21 wrote:
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
*****************************
Aug 8 '06 #6
Thanks Chuck

Nice site btw

Chuck Anderson wrote:
monomaniac21 wrote:
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
*****************************
Aug 9 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lucanos | last post by:
Hey All, I'm having trouble trying to create a PHP file which will generate a multipart email message (containing both an HTML formatted part and a Plain Text formatted part). I have Googled...
10
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the...
14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
8
by: LRW | last post by:
I'm not sure this message is totally appropriate for this group, so please, if anyone has a better group suggestion, let me know! My company sends out a monthly newsletter in HTML format to our...
5
by: Thierry | last post by:
Hello. Is it possible to send an email with some HTML code ? I tried the following code, where $msg == '<html><body>... blah blab blah etc.</body></html>' : // Adresse de l'expediteur...
0
by: nauticalmac | last post by:
I'm using CDO to send mail to the site owner from ASP pages with forms. Recently one of my forms is occasionally sending email with what seems to be an insertion which is replacing the plain text...
1
by: Stu Lock | last post by:
Hi, I have an app that has beenusing the JMail COM component to generate emails. I would like to switch to the using the .Net 2.0 MailMessage object instead - as it is more portable. The...
0
by: jlconde | last post by:
I have a classe to send mails. It runs on yahoo well but with hotmail I never receive the mails.I do not receive an error neither. I would need some strange header to make the hotmail like my...
2
by: anu b | last post by:
Now i am sending email to my friend using session variable... but my code is as below private bool SendEmail(string email) { try
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.