Solved

HTML Mail with cdonts vb asp

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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
CDO.Message not able to send attachement 5 40
Html Table Looping (part 2) 5 34
Use Mid in Html 6 21
Converting Stored Procedure to SQL Statement 5 39
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…

763 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