Need help adding a hyperlink mailto: item

M

mcse4u

I would like to be able to add a hyperlink to the posted form below
that automatically creates a hyperlink of the email address of the
person submitting the form. Can someone please help me with the code I
need to add?


<%@language=vbscript%>
<%option explicit

dim fromMail
fromMail = "(e-mail address removed)"
dim mailBody
mailBody = "Below is the result of your feedback form. It was
submitted by" & vbcrlf _
& Request.Form("email") & " on " & date() & vbcrlf & vbcrlf _
& "sender name: " & Request.Form("sendername") & vbcrlf & vbcrlf _
& "brides name: " & Request.Form("bridesname") & vbcrlf & vbcrlf _
& "grooms name: " & Request.Form("groomsname") & vbcrlf & vbcrlf _
& "address: " & Request.Form("address") & vbcrlf & vbcrlf _
& "city: " & Request.Form("city") & vbcrlf & vbcrlf _
& "state/province: " & Request.Form("state_province") & vbcrlf &
vbcrlf _
& "zip/postal code: " & Request.Form("zip_postalcode") & vbcrlf &
vbcrlf _
& "country: " & Request.Form("country") & vbcrlf & vbcrlf _
& "phone: " & Request.Form("phone") & vbcrlf & vbcrlf _
& "email: " & Request.Form("email") & vbcrlf & vbcrlf _
& "referred by: " & Request.Form("referredby") & vbcrlf & vbcrlf _
& "contact time: " & Request.Form("contacttime") & vbcrlf & vbcrlf _
& "package type: " & Request.Form("packagetype") & vbcrlf & vbcrlf _
& "party size: " & Request.Form("partysize") & vbcrlf & vbcrlf _
& "date: " & Request.Form("month") & "/" & Request.Form("day") & "/" &
Request.Form("year") & vbcrlf & vbcrlf _
& "time: " & Request.Form("time") & vbcrlf & vbcrlf
if Request.Form("mailbrochure") = "" then
mailBody = mailBody & "would NOT like to receive a brochure by mail" &
vbcrlf & vbcrlf
else
mailBody = mailBody & "would like to receive a brochure by mail" &
vbcrlf & vbcrlf
end if
mailBody = mailBody & "comments: " & Request.Form("specialrequests") &
vbcrlf & vbcrlf

Dim objCDO
Dim objConf
Dim objFields
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set objConf = Server.CreateObject("CDO.Configuration")
Set objFields = objConf.Fields


objFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing")
= cdoSendUsingPort
objFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "smtp.mailserver.com"
objFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 15
objFields.Update

call
sendmail(fromMail,Request.Form("recipient"),Request.Form("subject"),mailBody)

'Cleanup
Set ObjCDO = Nothing
Set objConf = Nothing
Set objFields = Nothing

Response.Redirect Request.Form("redirect")

' ********************************
' functions/subroutines follow
' ********************************

SUB sendmail( fromWho, toWho, Subject, Body )

on error resume next

Set objCDO.Configuration = objConf
objCDO.From = fromWho
objCDO.ReplyTo = Request.Form("email")
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.TextBody = Body
objCDO.Send


on error goto 0

END SUB

%>
 
M

Mike Brind

I would like to be able to add a hyperlink to the posted form below
that automatically creates a hyperlink

Hyperlinks can't create hyperlinks. Could you clarify your problem a
bit more please?
 
M

mcse4u

When the form is submitted, I would simply like the email to contain a
mailto: hyperlink using the person's email address who submitted the
form. This way the recipient can just click the link to open a new mail
message to that person.
 
M

Mike Brind

When the form is submitted, I would simply like the email to contain a
mailto: hyperlink using the person's email address who submitted the
form. This way the recipient can just click the link to open a new mail
message to that person.

At the moment, your email is being created as plain text. Some email
clients will create a hyperlink for the email address, and some won't.
You could try to force a hyperlink by putting emailto: in front of the
email address, but the only way to guarantee it will appear as a
hyperlink is to use html format for the email body.
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top