473,699 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2139
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_str ing
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

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

Where some_random_str ing 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
14233
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 for it, and found previous entries in Google Groups, but I just can't get it to work. My PHP File contains the following:
10
4189
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 DB as formatted HTML so ASP just drops them right into a page shell. Now, we want to send out a newsletter email containing some of those items. No problem sending as HTML. However, some of the members want just plain text. Is there some magic...
14
6886
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 HTML doc. The HTML version doesn't have anything fancy, just internal links. So the tool must be able to delete internal links and anchors from the HTML version, but leave external links in simplified form. That is, the HTML version would say <a...
8
5311
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 account holders. We get a couple of people with auto-responders saying they don't accept HTML e-mails, please send plain-text. Is there some way to format an e-mail with both versions, maybe defaulting to HTML format but display plain-text if it...
5
2330
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 $entete = "From: $from \n";
0
2133
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 part of the email with something else. Looking at the server sent email source, the hacked emails have the following: This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C60610.91D1FFA0 Content-Type: text/plain;...
1
4632
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 jmail component allowed me to set both an HTML body and a text body - this meant that if a users' email client didn't support html - the user would see the text only version with an html attachment. The MailMessage object only appears to have one...
0
6315
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 email???? My code is: import java.net.*; import java.io.*; import java.util.*;
2
18172
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
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9172
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4374
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.