|
Ok, I have this CDO email script that I would like to be able to use to send a user their username and password when requested.
The problem is that I can't seem to be able to use a variable in the .To Property of the CDO.Configuration Class. Can anyone help? Here is my script:
'-----------------------------------------------------
'Create Objects
Dim objMessage, objConfig
Set objMessage = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
'Create Configuration
With objConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.whatever.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update()
End With
Test = Trim(Request.Form("email"))
'Send Email
With objMessage
.Configuration = objConfig
.To = Test
.From = "blah@blah.com"
.Subject = "Requested Information"
.HTMLBody = "This message is being sent because you requested your login information from <a href=""http://www.blah.com"">http://www.blah.com</a>.<br><br>Your information is as follows:<br><ul><li>User Name = " & member("username") & "</li><li>Password = " & member("password") & "</li></ul><br>"
End With
'Destroy Objects
Set objMessage = Nothing
Set objConfig = Nothing
response.redirect("cardless.asp?msg=s")
'----------------------------------------------------
|