RSS Forums RSS

Error message when running ASP email script

Reply
Posts: 1
Reputation: jigar_eng is an unknown quantity at this point 
Solved Threads: 0
jigar_eng jigar_eng is offline Offline
Newbie Poster

Help Error message when running ASP email script

  #1  
May 31st, 2004
When I run the following ASP email script I get error. I am sending the script and error messege both. Please help me as soon as possible as I am a fresher at ASP scripting.

The script:-

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>

<%
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 test@devasp.com, or they keep the "From" property
' as webmaster@devasp.com 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"

%>
</body>

</html>


The error message:-

Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/calendar/email2.asp, line 11
Option Explicit
AddThis Social Bookmark Button
Reply With Quote  
Posts: 155
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Error message when running ASP email script

  #2  
Jul 13th, 2004
Option Explicit must be the first thing declared in the asp file. That goes above everything else including the html.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote  
Posts: 32
Reputation: RobUK is an unknown quantity at this point 
Solved Threads: 1
RobUK RobUK is offline Offline
Light Poster

Re: Error message when running ASP email script

  #3  
Jul 13th, 2004
LMAO..... how many of us fell into this trap at the beginning? We were prolly just as confused as this guy!
Rob - DMOZ Editor
Web Design Forums - Free website critiques. Web design + SEO Advice
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 7848 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:04 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC