954,135 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Error message when running ASP email script

<%
Option Explicit

Dim objNewMail

' First create an instance of NewMail Object
Set objNewMail = Server.CreateObject("CDONTS.NewMail")

' After an instance of NewMail Object has been created.
' If you like you can use this one line of code to send the mail.
' objNewMail.Send From, To, Subject, Message
' or you can give every value seperate

objNewMail.From = "webmaster@devasp.com"
objNewMail.To = "test@devasp.com"

' Please replace the "From" and "To" email addresses with your
' own valid email address. I recieve too many emails
' from people who test this sample and keep sending
' emails to [email]test@devasp.com[/email], or they keep the "From" property
' as [email]webmaster@devasp.com[/email] and I get response of
' undeliverable emails.
' NOTE: If the "To" or "From" properties of CDONTS contain
' invalid email address you will not recieve the email.

objNewMail.Subject = "This is a test Mail"
objNewMail.Body = "This is the Body text of this test mail."
objNewMail.Send

' After the Send method, NewMail Object become Invalid
' You should set it to nothing to relase the memory

Set objNewMail = Nothing

' If you want to send another mail
' you have to create a new instance of NewMail Object again.

Response.Write "Email has been sent"

%>

jigar_eng
Newbie Poster
1 post since May 2004
Reputation Points: 10
Solved Threads: 0
 

Option Explicit must be the first thing declared in the asp file. That goes above everything else including the html.

Drew
Junior Poster
166 posts since Apr 2004
Reputation Points: 25
Solved Threads: 7
 

LMAO..... how many of us fell into this trap at the beginning? We were prolly just as confused as this guy!

RobUK
Light Poster
32 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You