473,513 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDO question -- generating email messages in HTML format

CB
CDO is perhaps the most obscure art in web programming, but I hope someone
would understand my issue. I have an ASP web application that needs to send
email messages in HTML format only -- there is no plain text version. The
messages are summaries of answers that people have input into an online
survey, and need to have a tabular form.

The following somewhat plausible code does not work:

dim OMsg
Set OMsg = Server.CreateObject("CDO.Message")
OMsg.Fields("urn:schemas:mailheader:return-path") = BounceEmail
OMsg.Fields("urn:schemas:mailheader:content-type") = "text/html"
OMsg.Fields.Update

The return path header is set as desired, but the content type header
stubbornly defaults to "text/plain". What is the secret to setting that
header?

I have seen lots of code examples on the MSDN site for setting the
content-type of body parts, but it seems needlessly complicated for my
situation and doesn't work on my system anyhow (unknown ProgID error). So I
was hoping to just set the message-level header to "text/html". (If I edit
one of the messages from my script in notepad, changing the header to
text/html by hand, it then is rendered correctly in email clients.)

Suggestions appreciated
Nov 22 '05 #1
1 5492

"CB" <CB@discussions.microsoft.com> wrote in message
news:DC**********************************@microsof t.com...
CDO is perhaps the most obscure art in web programming, but I hope someone
would understand my issue. I have an ASP web application that needs to
send
email messages in HTML format only -- there is no plain text version. The
messages are summaries of answers that people have input into an online
survey, and need to have a tabular form.

The following somewhat plausible code does not work:

OMsg.HTMLBody = "your html"

I find that is all i have to do

dim OMsg
Set OMsg = Server.CreateObject("CDO.Message")
OMsg.Fields("urn:schemas:mailheader:return-path") = BounceEmail
OMsg.Fields("urn:schemas:mailheader:content-type") = "text/html"
OMsg.Fields.Update

The return path header is set as desired, but the content type header
stubbornly defaults to "text/plain". What is the secret to setting that
header?

I have seen lots of code examples on the MSDN site for setting the
content-type of body parts, but it seems needlessly complicated for my
situation and doesn't work on my system anyhow (unknown ProgID error). So
I
was hoping to just set the message-level header to "text/html". (If I
edit
one of the messages from my script in notepad, changing the header to
text/html by hand, it then is rendered correctly in email clients.)

Suggestions appreciated

Nov 22 '05 #2

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

Similar topics

2
5328
by: Gordon H. | last post by:
I'm trying to email a HTML link to a HTML file attached in the same message. I DO NOT want to have the attached HTML file displayed in the message, I just want a link in the email to the HTML file...
2
1339
by: Bob Avallone | last post by:
I found this code of the internet that should create a mail message: 'Create an instance of the MailMessage class Dim objMM As New MailMessage 'Set the properties objMM.To =...
1
1764
by: Shahzad Atta | last post by:
Hi there, I need to save a word.doc file in html format. Any help will be appreciated. Best Regards, Shahzad Atta.
3
1419
by: Ofir Amitai | last post by:
Hi, I have this very annoying problem: I'm trying to send email in html format through smtp but i always get it in text format. here is the code: MailMessage msgMail = new MailMessage();...
1
2074
by: bidllc | last post by:
I'm working on a minor bug from an open source bug tracking system (bugtracket.net). It's a great app, but I don't want to bother the creator any more than I have to, so I thought I'd pose the...
1
1153
by: gokhanoz | last post by:
Hi. I can successfully download my email messages with their attachments from my POP3 servers. But, I can not display them correctly to the user. I need a component which is similar to the outlook...
0
1379
by: charlie weaver | last post by:
Is it possible to send an email in HTML format using and Access Form created with VB 6? Currently my form sends as RTF, but I cant seem to figure out how to send in HTML format.
18
2364
by: Grant Edwards | last post by:
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages?...
1
4846
by: vdosev | last post by:
I have MS Access Database clients database. When client places an order – I have developed VBA code to create an email confirming the details of the order. Everything is coded, but the body text...
0
7259
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
7158
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
7535
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...
1
7098
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
5683
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,...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1592
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 ...
0
455
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.