Forum Moderators: open
I am trying to automate the process of taking an email address from a contact form and sending it to the unique email address that will add the person to my mailing list.
This unique address is formed from the users own email address. So for john@hotmail.com, the subscribe address would be:
mailinglist-subscribe-john=hotmail.com@mywebsite.com
What I am trying to do is take the @ sign in John's email, replace it with a =, and then send the email. My code is as follows:
<%
Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
'Replace the @ sign with an =
newEmail = Replace Request(Email,'@','=')
'Set key properties
objMail.From = Request("Email")
objMail.To = "mailinglist-subscribe-" & 'newEmail' & "@mywebsite.com"
objMail.Subject= "Mailing List addition"
objMail.TextBody = "Email" & ": " & Request("Email")
'Send the email
objMail.Send
'Clean-up mail object
Set objMail = Nothing
response.redirect "redirect.html"
%>
I can't work out how to write the changed email address in the string... I am sure it is really simple but I am not an ASP programmer, so I don't know the syntax of the language well enough to know how to write this in.
Any help would be much appreciated...
G
<%
Dim objMail
'Create the mail object
Set objMail = Server.CreateObject("CDO.Message")
'Replace the @ sign with an =
newEmail = Replace (Request("Email"),"@","=")
'Set key properties
objMail.From = Request("Email")
objMail.To = "mailinglist-subscribe-" & newEmail & "@mywebsite.com"
objMail.Subject= "Mailing List addition"
objMail.TextBody = "Email" & ": " & Request("Email")
'Send the email
objMail.Send
'Clean-up mail object
Set objMail = Nothing
response.redirect "redirect.html"
%>