|
-
October 21st, 2002, 05:18 AM
#1
Sendin E-mail in ASP CDONTS Not working
I'm learing ASP and I'm using IIS 5.1 . I believe the version that comes with XP Professional.
In my book it tells me to use CDONTS.NewMail but I get this error.
Server object error 'ASP 0177 : 800401f3'
Server.CreateObject Failed
/mailscript.asp, line 2
Invalid class string
Here is what my script looks like
Code:
<%
Set Mail=Server.CreateObject("CDONTS.NewMail")
Mail.To="[email protected]"
Mail.From="[email protected]"
Mail.Subject="Testing Script"
Mail.Body="Message Body is here"
Mail.Send
Set Mail=nothing
%>
Now Microsoft support said I think they said that XP Pro doesn't have the
CDONTS.dll that I should use a different one but I don't seem to have that .dll either
so what should I do? Did anyone have the same problem and find a
solution? Would it work if I found the .dll from somewhere on the internet?
I do have the mail server running because I thought that might be the problem but it wasn't
-
October 21st, 2002, 09:04 AM
#2
CDonts.dll
Here y'go - a copy of cdonts.dll from my NT4 box. If you have any problems I'll see if I can find the 2k version. Let us know how you get on. The dll should live in you system32 directory.
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
October 28th, 2002, 03:11 AM
#3
Junior Member
July,
You need to declare "mail" as a varible:
<%
Dim mail
Set Mail=Server.CreateObject("CDONTS.NewMail")
Mail.To="[email protected]"
Mail.From="[email protected]"
Mail.Subject="Testing Script"
Mail.Body="Message Body is here"
Mail.Send
Set Mail=nothing
%>
Boomer
-
October 28th, 2002, 08:56 AM
#4
Boomer > Only if you've got Option Explicit set.
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
October 28th, 2002, 05:30 PM
#5
Are you completely sure you have the feature installed?
If you haven't got the SMTP server installed, CDONTS won't be available. The one is linked to the other.
Sounds to me like you didn't install the SMTP service. If your version of windoze doesn't support the SMTP service, CDONTS will never work on it (but AFAIK, all versions of NT/ 2k do)
Don't bother copying cdonts.dll from someone else's box, that will lead to trouble. It won't be the right version, and it won't work anyway unless you have the SMTP service.
-
October 28th, 2002, 07:31 PM
#6
slarty is correct....you need to make sure the SMTP server is installed and running. Also make sure you have cscript.exe and wscript.exe installed in the %systemroot%.
Also ntsa...declaring your variables is a standard in good programming practice. Even if not required, he should still be "diming" his variables.
-
October 29th, 2002, 01:20 AM
#7
Quad > Yes - I would actually recommend using option explicit in ALL code, so that you HAVE to declare your varaibles (saves hours of debugging in the long run).
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|