473,395 Members | 2,467 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,395 software developers and data experts.

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**@createsolutions.net

Nov 17 '05 #1
2 4514
On Sun, 27 Jul 2003 20:06:04 -0700, "Paul Turley"
<pa**@createsolutions.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("CDONTS.NewMail")
msg.From = ...
...
msg.BodyFormat = 0 '-- This is the value of cdoBodyFormatHTML
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=strText ' the var that holds your HTML

instead of

msg.Text=strText

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

I suggest you use the following code:

Dim iMsg
Dim iConf

Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")

Dim Flds
Set Flds = iConf.Fields

With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.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
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....
3
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?...
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: 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...
6
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...
3
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...
5
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...
1
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...
1
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...
2
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 .=...
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,...
0
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...
0
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,...

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.