insert clickable email address in CDO.Mailer sent email

D

Dave Lagergren

I have a form on our website for contacting our reps. There is a drop down
for the Rep and fields for name, email, phone, message.

On Submit I send the results in a email to the Rep. I would like the
customers email address to be clickable. I can use mailto: but that displays
on the email as a hyperlink "mailto: (e-mail address removed)". I may be picky
but I would like it to be a clean hyperlink.

Here is my code:
<%
strMessage = "Dear " & Rep & vbcrlf&_
"Your customer " & CustName & " wants to talk to you about: " & Message &
"." & vbcrlf&_
"Their email is " & "mailto:" & Email & " and their phone number is " & phone

' Send original email - to the Rep
Set myMail = CreateObject("CDO.Message")
myMail.Subject = "Customer Request"
if len(Email) > 7 then ' Minimal address checking
myMail.From = Email
else
myMail.From = "(e-mail address removed)" ' If no address entered
end if
myMail.To = RepEmail
myMail.bcc = "(e-mail address removed)"
myMail.TextBody = strMessage & ""
myMail.Send
set myMail = nothing

%>

Thanks!
 
M

Mike Mueller

Dave

The first thing I would do is to make the senders email address required and
validated
As for what you asked about, I would make it an HTML email.
**I changed the email addresses in the script as to not compromise them (any
more than has already been done)**

<%
strMessage = "<p>Dear " & Rep & "</p>"
strMessage = strMessage & "<p>Your customer " & CustName & " wants to talk
to you about: " & Message & "<br>"
strMessage = strMessage & "Their email is <a href=""mailto:" & Email">" &
Email & " and their phone number is " & phone & </p>

Set myMail = CreateObject("CDO.Message")
myMail.Subject = "Customer Request"
if len(Email) > 7 then ' Minimal address checking
myMail.From = Email
else
myMail.From = "(e-mail address removed) ' If no address entered
end if

myMail.To = RepEmail
myMail.bcc = "(e-mail address removed)"
myMail.HTMLBody = strMessage
myMail.Send
set myMail = nothing
%>
 
D

Dave Lagergren

I always forget to clean up something before I post!

Thank for sanitizing for me, and for the input.

The code will not work as entered but I get the idea and am cleaning it up.
 
M

Mike Mueller

I had a feeling that was going to happen, I pulled the code from a CDO
messager that I use just to send out a normal url. I was going to slap a
disclaimer stating that the coding may need some fiddling with. I generally
just use the reply button :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Email problems 12
Sending e-mail from a ASP form 6
cdo.message cdoReturnReceiptTo 1
mail in asp 1
CDO 0
Email 9
CDO.Message.1 error '8004020c' 2
E-mail web response 6

Top