| | |
Error message when running ASP email script
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2004
Posts: 1
Reputation:
Solved Threads: 0
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
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
Option Explicit must be the first thing declared in the asp file. That goes above everything else including the html.
![]() |
Similar Threads
- cannot find server error message (Web Browsers)
- Server Error message when opening asp.net applicationm (ASP.NET)
- Error message when running ASP login page (ASP)
- error message when clicking on url in email (Windows NT / 2000 / XP)
- Error message when running simple Java pgm (Java)
Other Threads in the ASP Forum
- Previous Thread: string not working
- Next Thread: ASP how to make the page not remembered in address bar?
Views: 8431 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile query record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit update web webserver windows7





