Forums

This topic is locked

inserting hyperlink in email

Posted 15 Feb 2003 12:18:20
1
has voted
15 Feb 2003 12:18:20 Mark Taylor posted:
I'd like to insert a hyperlink from an email (using newsletter behaviour below) but all I get is the
http:\\www.mywebsitename.com text without the hyperlink. Anyone know what I'm doing wrong? I've just spent two hours looking for a solution but no luck.



<% ' Newsletter Behaviour Robert Paddock 29/01/2001 v.1.0

' Chect to see if form already submitted
If Request("RP_FLAG" ="true" then

Dim subject, message,no_sent

subject = Request.Form("subject"
message = Request.Form("message"

message = message + "www.mywebsitename.com"

While Not Recordset1.EOF
Set mail = Server.CreateObject("CDONTS.NewMail"
mail.From = " "
mail.To = Recordset1.fields.item("emailaddress".value
mail.Subject = subject
mail.Body = message
mail.Send
Set mail = Nothing
Recordset1.MoveNext

Wend

Response.Redirect "zzz_admin.asp"
End If

%>

Replies

Replied 19 Feb 2003 18:09:48
19 Feb 2003 18:09:48 Brent Colflesh replied:
Dear Zooropa,
You would need to add HTML, and the client receiving the message has to have HTML formatting as their default, most Windows clients will auto-format protocol strings to be URLs. If you have your default as text messages only, you just get the text.

Change the "message =" line to:

message = message + "<a href=\"www.mywebsitename.com\">www.mywebsitename.com</a>"

Regards,
Brent

Replied 20 Feb 2003 01:20:31
20 Feb 2003 01:20:31 Mark Taylor replied:
Brent, Thanks for pointing me in the right direction. I managed to get the link to work usin:

message = message + "<p></p>" + "<a href='www.mynamesite.com'>website</a>"

Note the use of double " and single ' quotation marks.

This creates a link to mynamesite.com when you click on the word "website". Only problem I encountered is if I want to change from "website" to "visit website", the link is lost and it just shows up as plain old text in the email message. Anyone know a way around this? Thanks

Reply to this topic