Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

Error while sending ASP e-mail using cdosys

1:05 pm on Jul 19, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:July 4, 2009
posts: 51
votes: 0

Hi all,

My "password change" .asp form sends an e-mail to the user (to his/her provided e-mail) when he/she changes a password.
But with the code below, I do get the error message:

Error Type:
The event class for this subscription is in an invalid partition
/changepass.asp, line 129

The code looks like this:



dim myMail
set myMail= CREATEOBJECT("CDO.Message")
myMail.From = "services@example.com"
myMail.To = "Email"
myMail.Subject = "Your example.com password"
myMail.Textbody = "Dear " & FirstName + " " + LastName + ", Your example.com password is:"
myMail.HTMLBody = htmbdy
htmbdy="<html><body><table><tr><td>Your Password: </td><td>"& Pass &"</td></tr></table></body></html>"

myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = ""
myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
myMail.Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/SendUsername") = "services@example.com"
myMail.Configuration.Fields.item("http://schemas.microsoft.com/cdo/configuration/SendPassword")= "password"

set myMail=nothing



The line 129 is: myMail.Send
The form changes the password within the db but does not send an e-mail to the user.

1) the domain name is a working one. I do get e-mails from that domain and can also send e-mails from that domain with outlook.
2) even if I change the members e-mail address to show another domain, no e-mails are send.
3) f I change the sendusing to = 1, and the smtpserver to = localhost,
then it tells me that the passw. has been cahnged but no e-mail is being send at all.

Any ideas why this happens? Thanks for all your comments

7:03 pm on July 19, 2009 (gmt 0)


WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
votes: 3

Is it the one users account or everyone's?

If it is only the one user it could be she has a character in her email address that is causing the problem.

If it is everyone's, it could be something else causing it.

Has the SMTP server settings changed from when the asp script was working till now? Or have file permissions been changed on the IIS SMTP mail folders.

Or has a new firewall been installed recently or been updated?

Here is a quick reference site which I turned up. It might help solve this problem or at least shed more light on it.

Why does CDO.Message give me 8004020F errors [classicasp.aspfaq.com]

8:09 pm on July 19, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:July 4, 2009
votes: 0

Hi Ocean10000,

It does not matter to whom that e-mail is going to be sent.It does not send the e-mail.

I do not know whether the smtp server settings have changed or not since it is a third party hosting provider who has provided me its smtp server names. Actually, I have no problems in sending e-mails through outlook with this smtp address. But I don't know if things change if this address allows sending mails with .asp forms over itself.

The file permissions on the IIS smtp folders did not change.

Even if I exit the firewall, the page gives me the same error message. It does not send the e-mail.:(

10:40 am on July 26, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:July 4, 2009
posts: 51
votes: 0

Hi friends,

I have changed my code to this:

Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.example.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60

ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="example@example.com" 'Definitely a different domain than it looks like here
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password" 'Instead I have the real pass here


'End remote SMTP server configuration section==

ObjSendMail.To = "user@example.com"
ObjSendMail.Subject = "cdosys trial"
ObjSendMail.From = "admin@example.com"

ObjSendMail.TextBody = "Cdosys trial"


Set ObjSendMail = Nothing



The page executes without problems and no error messages,
but the sender address receives an undeliverable message like this:

Invalid final delivery userid: WebAdministrator@localhost

Original message follows.

Received: from SMTP32-FWD by example.com
(SMTP32) id A2AE2022D00005B6D; Sun, 26 Jul 2009 05:07:33 -0500
Received: from faberbd6156bbb [] by netcfm.com with ESMTP
(SMTPD-8.22) id AAE4021C; Sun, 26 Jul 2009 05:07:32 -0500
Thread-Topic: cdosys trial with asp code
thread-index: AcoN2NO6R5HARLFTTWC3v2Y4g6qGgQ==
From: <admin@example.com>
To: <user@example.com>
Subject: cdosys trial
Date: Sun, 26 Jul 2009 13:07:04 +0300
Message-ID: <2C64447B818C448F8497A384C71EE70E@faberbd6156bbb>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft CDO for Exchange 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579

cdosys trial with asp code


Any info or comment why the e-mail can not be delivered?
My additional information:

1) I have standard install of IIS 5.1. SMTP component of IIS is installed.
2)Exited the Sygate firewall.
3)Im not behind a proxy.
4)Upon an advice, I've made sure that I have set to perform a direct delivery before using the smart host.
Smtp properties --> Delivery tab - Advanced button
5) Do not take the text bodies into consideration, I have changed them a bit.

Any Info or comments are appreciated.
Thank you for your support.

4:07 pm on July 26, 2009 (gmt 0)


WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
votes: 3

I do not believe it has anything to do with your code.

I think your email messages are being forwarded to an exchange server. And some setting or spam filter on the exchange server is rejecting the email messages you are trying to send.

You may wish to check to see if your webservers IP is on a spam list. If it is it could be causing all of these problems.

7:33 pm on July 27, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:July 4, 2009
votes: 0

Bingoooo! I have succeed to get it right and I've got to share it with you!

Now I have logged into the e-mail administration url of my domain. It can be [mail.example.com:8343...] (port may vary).
2)There must be a setting for the "Alias Administration" somewhere on the page. Usually a drop-down list at Ipswitch console.
3) On the Alias administration press on "Add" and enter the e-mail address for which you have received an "Undeliverable Mail". Within this mail it should say:
"Invalid final delivery userid: WebAdministrator@localhost"
The name before localhost may differ.
4) Enter that e-mail as an alias into the alias admin list and save it. (you can chose a name for that alias but the alias itself should be an e-mail address)

And that worked for me.

I hope it will also work for you too.

Good luck!