Solved

HTML Mail with cdonts vb asp

Posted on 2000-03-22
3
340 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 information …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

896 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now