Solved

HTML Mail with cdonts vb asp

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

726 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