Solved

HTML Mail with cdonts vb asp

Posted on 2000-03-22
3
349 Views
Last Modified: 2008-02-26
I am trying to use the following code to send HTML format mail, but I get cdoBodyFormatHTML variable undefined.  Sending regular text (without the bodyformat) works fine.

Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = "don@bbb.com"
objMail.From = "donb@bbb.net"
objMail.Subject = "Test Message"
objMail.BodyFormat = cdoBodyFormatHTML
objMail.Body = msg
objMail.Send
Set objMail = Nothing

msg is HTML
0
Comment
Question by:donb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
rmullins earned 50 total points
ID: 2647779
It is undefined unless you did a server side include for a file that has that constant defined.

cdoBodyFormatHTML is referred to in the documentation if you use constants. In this case, if you look at your code, it is simply a variable that is undefined.

The easiest (although not the most readable) would be to replace:
"objMail.BodyFormat = cdoBodyFormatHTML"
with
"objMail.BodyFormat = 0" (zero, not the letter)

Alternatively, you could declare constants either on the page or in an include file.
An example that you could use is:
"Const cdoBodyFormatHTML = 0"

As a side note, make sure you have the SMTP Service running when you execute this.

Happy mailing,
-- Rob --
0
 

Author Comment

by:donb1
ID: 2662670
Thanks
0
 
LVL 3

Expert Comment

by:rmullins
ID: 2665080
You are very welcome. :-)
-- Rob --
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Server Timeout with Loop 6 63
Select record with the most recent date 14 71
Weighted Randomizing 6 38
Clear input text 15 32
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question