473,782 Members | 2,465 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to send mail in HTML format

How do I format a message so it shows up as a web page in the mail reader.
In the body of my message, I'm including a '<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Traditional//EN">' tag and standard <html><body> tags
but this all shows up as text in the message. What's the secret?

--
Paul Turley, MCSD, MCAD, MCT, MSF Practitioner, A+ Technician
pa**@createsolu tions.net

Nov 17 '05 #1
2 4537
On Sun, 27 Jul 2003 20:06:04 -0700, "Paul Turley"
<pa**@createsol utions.net> wrote:
I can't get the SmtpMail object to work on our ISP's production server so
I'm stuck with using CDONTS in an ASP page. My code looks like this:

Set msg = CreateObject("C DONTS.NewMail")
msg.From = ...
...
msg.BodyForm at = 0 '-- This is the value of cdoBodyFormatHT ML
msg.Body = ...
msg.Send()
<If there is a more appropriate group to post this to, please let me know.
I can't find a group for CDO>


Does your ISP support ASP.NET? Is the web page in question a ASP page
or a ASP.NET page. If ASP.NET, mail functions are exposed via a
different method than CDONTS or CDO.

I suspect you are using ASP not ASP.NET? If so, and if your ISP uses
Win2k or better, use CDO via ASP, not CDONTS. If you want to use CDO
as I suggest, check out the MSDN library URL:

http://msdn.microsoft.com/library/de...asp?frame=true

For a short answer, if I recall correctly CDONTS will send the message
as HTML if you load up the property

msg.HTMLText=st rText ' the var that holds your HTML

instead of

msg.Text=strTex t

Dan Bush
me@REMOVE.danbu sh.com
Nov 17 '05 #2
Hello,

I suggest you use the following code:

Dim iMsg
Dim iConf

Set iMsg = CreateObject("C DO.Message")
Set iConf = CreateObject("C DO.Configuratio n")

Dim Flds
Set Flds = iConf.Fields

With Flds
.Item("http://schemas.microso ft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microso ft.com/cdo/configuration/smtpserver") =
"SMARTHOST"
.Update()
End With

With iMsg
.Configuration = iConf
.To = "<aa*@microsoft .com>"
.From = "<bb*@microsoft .com>"
.Subject = "hello"
.HTMLBody = "<html><b>Hello </b></html>"
.Send()
End With

--
Parker Zhang
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '05 #3

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

Similar topics

1
5887
by: Gernot Hillier | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! I'm the developer of a Linux ISDN application which uses embedded Python for controlling the communication. It starts several threads (i.e. one for each incoming call and for outgoing faxes) which run Python scripts in embedded Python interpreters which in turn do the real communication stuff. Any incoming data or confirmations of done jobs are sent via Email.
3
1761
by: Gene Ellis | last post by:
Hey everyone, I have a simple task. I want to take an XML file, pull out the elements in it, format them, and then send an html email based on it. What are the necessary steps? Any suggestions? I know how to write XSL style sheets. Most of my confusion lays in how to get the XML elements for matted and the transformed in such a form that is email-able. Thank you so much!
8
5315
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
4414
by: nate heaton | last post by:
I would like to do the following with C# in my asp.net app: Open the default email client of the user (just like a mailto: link would). Supply the subject line and put some HTML (including an image) into the body of the email. Any help would be greatly appreciated. -- Nate Heaton
6
11188
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I will include the code I originally used. I understand I should switch from CDONTS to CDO mail but after several sttempts I am finding a very hard time getting the new CDO mail to work properly. Any assistance with this would be greatly...
3
2136
by: marsandys | last post by:
Hello, I have this code below, which I am trying to have it send HTML formatted mail with embedded images. I can get this to send the mail, but it spits out a bunch of junk . I know this should be pretty simple, but I have been pulling my hair out for hours with this. :/ Can someone smart pleaseeee help me tweak this code to work? <?php // Read POST request params into global vars
5
2324
by: Yossi Naggar | last post by:
Hello to everyone, Does anybody know how to send html formatted messages with asp.net? I tried to send such messages with the code below but the content type is wrong. The content type is multi-part and not html/text as expected. The code i use is: mailmsg.To = "XXX@XXXX.com" mailmsg.Subject = "some subject string" mailmsg.Body = <-- an html format body --> mailmsg.From = "XXX@XXXX.com"
1
1104
by: Husam | last post by:
Hi EveryBody: I made windows application project by using Vb.Net 2003. The Objective of this project is to let the user send e-mails. I add System.web.dll as refrance to my project to use system.web.mail class. When I write an message and I change the font and the color of this message and I send it, It reached to the recipent as Text mail without the font and the color that I setted to the message before it has been sent ? either when...
1
1097
by: Husam | last post by:
Hi EveryBody: I made windows application project by using Vb.Net 2003. The Objective of this project is to let the user send e-mails. I add System.web.dll as refrance to my project to use system.web.mail class. When I write an message and I change the font and the color of this message and I send it, It reached to the recipent as Text mail without the font and the color that I setted to the message before it has been sent ? either when...
2
1837
by: urbanedge | last post by:
I've just acquired a site and uploaded to godaddy and the email function won't work. I'm new to php and I'm not able to determine where the issue is. I've commented out $this->header .= $this->body; and I get a blank email to send. I've stripped down the body file but there still seems to be a problem. I'm not sure where to look now. This is the body file. <?php /******************** EMAIL ***************************/ $sRuta =...
0
9641
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
10313
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
10146
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...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9944
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...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5378
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...
1
4044
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
3643
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.