Forum Moderators: open
I am experiencing a very interesting cdosys behaviour on my .asp page. It is as follows:
I have an .asp page which sends the changed password information to the e-mail of the customers. It does this with cdosys.
The problem is that the page only sends these e-mails to the customers when the ObjSendMail.To = variable is filled with an e-mail address instead the previously sessioned "Email" variable.
When I put the "Email" variable into the field, (I have sessioned the Email variable before) I get the error:
Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
/passchange.asp, line 145
Here is the code:
-------------------------------------------
<%
Else 'Do not take any previous code into consideration this part is just for sessioning and works ok
RecordsetControl("Password") = new_pwd
Fname = RecordsetControl("FirstName")
Lname = RecordsetControl("LastName")
Email = RecordsetControl("Email")
RecordsetControl.Update
RecordsetControl.Close
session("FirstName") = FName
session("LastName") = LName
session("Password") = new_pwd
session("Email") = Email
%>
<%
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
'This section provides the configuration information for the remote SMTP server.
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 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="example@example.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="password"
ObjSendMail.Configuration.Fields.Update
'End remote SMTP server configuration section==
ObjSendMail.To = "Email"
ObjSendMail.Subject = "Your new Example.com password"
ObjSendMail.From = "example@example.com"
ObjSendMail.TextBody = "Dear "& FName &" "& LName &", your new Example.com password is: " & new_pwd & " thank you"
ObjSendMail.Send
Set ObjSendMail = Nothing
%>
------------------------------------------------
If I enter an e-mail address like ObjSendMail.To = user@example.com instead the "Email" variable, no matter what e-mail it is, it sends the mail without any error.
What might be the reason for giving the above error when not entering an Email address but the Email variable?
Thank you for your considerations.