By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,225 Members | 2,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,225 IT Pros & Developers. It's quick & easy.

A simple e-mail error - HELP

P: 12
This is going to be a really simple question to answer (I hope). I have used this code before and it worked. However, I am using this code on a different web server, but the web server does claim to support it!

My code:

dim MyMail, SmtpMail

Set MyMail = Server.CreateObject("CDO.Message")
SmtpMail.SmtpServer = "mail.DOMAIN.com"

MyMail.To=Request.Form("txtEmail")
MyMail.BCC="dave@DOMAIN.com;"
MyMail.From="sales@DOMAIN.com"
MyMail.Subject="Thank you for contacting DOMAIN"
MyMail.HTMLBody="text goes here"

MyMail.Send
Set MyMail=Nothing


The error I get is

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/contact-sent-test.asp, line 12



(Line 12 is the MyMail.Send)

Previously, I tried this with out the SmtpMail.SmtpServer = "mail.DOMAIN.com" and the error message was "access is denied"

Any ideas? Thank you
Jan 22 '08 #1
Share this Question
Share on Google+
1 Reply


P: 12
The error is now sorted. It needed a valid e-mail address in BOTH To and From... D'oh!!

Dave
Jan 22 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.