Trying to Send Email with Classic ASP

Set myMail=CreateObject("CDO.Message")
	myMail.Subject="A Subject"
	myMail.From="email address"
	myMail.To= "email address"
	myMail.HTMLBody = "<h2>Some Text</h2>"
	set myMail=nothing

Open in new window

I try using the above code to send an email, but the page generates this errror:
CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

Can anyone tell me how to fix this?
Who is Participating?
Wayne BarronConnect With a Mentor Author, Web DeveloperCommented:
Is this the entire code?
Method 3 is what I use.

Give it a shot and see if it will correct your issue.

nickgross19Author Commented:
Tried method 3 and got this error:

error '8004020f'

any other suggestions?
nickgross19Author Commented:
oh i made a mistake using the code, i forgot to set a property.  This worked, thanks.
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

nickgross19Author Commented:
thanks for the site.
Please take a look at these articles:

CDO.Message.1 error '80040220':

error '8004020f':
Wayne BarronAuthor, Web DeveloperCommented:
Glad to help.
Happy Coding.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.