Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Error Pages

Status
Not open for further replies.

UncleCake

Technical User
Feb 4, 2002
355
US
Hi,

I successfully created a custom 404 error page which also e-mails me information using CDONTS. When I tried to use the same script on the 500.100 error page I am getting this error:

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'objMessage'

/Error/500-100.asp, line 291

My CDONTS script goes like this:
set objMessage = server.CreateObject("CDONTS.NewMail")
objMessage.BodyFormat = CdoBodyFormatHTML
objMessage.MailFormat = 0
objMessage.From = strFrom
objMessage.To = strTo
If len(strCC) > 0 then
objMessage.Cc = strCC
End If
if len(strBcc) > 0 then
objMessage.Bcc = strBCC
end if
objMessage.Body = strBody
objMessage.Subject = strSubject

objMessage.Send
Set objMessage = Nothing

Line 291 is the first line: set objMessage = server.CreateObject("CDONTS.NewMail")

Is there some reason that I could use CDONTS on the 404 page and it would error out on the 500.100 page?

-Uncle Cake
 
Sounds like you have OPTION EXPLICIT

dim objMessage
set objMessage = server.CreateObject("CDONTS.NewMail")
objMessage.BodyFormat = CdoBodyFormatHTML

etc.... -----------------------------------------------------------------
[pc] Be nice. It's only doing what you tell it to do.
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top