This topic is locked
[SOLVED]

  Email Hyperlink - removing spaces from hyperlink

5/23/2011 11:25:20 AM
ASPRunnerPro General questions
B
beachldy author

Hey all, good morning.
I'm sending a hyperlink to email, but it has spaces in it, so it's not something the user can click on without hi-lighting the hyperlink manually. Example: "www.mystest.com/Page one.html". It will only be underscored as a hyperlink up to the space, so it shows "www.mystest.com/Page" underscored, and the rest is not underscored as a hyperlink.
I've tried adding "<" and ">" on both sides of the hyperlink text, but that doesn't work.
I've also tried the REPLACE statement,

Replace("Driving Directions: " & Session("DrivingDirections"), " ", "%20"), but the spaces don't get replaced by %20.
Any ideas on how to get the hyperlink to ignore the spaces and make it underscored in its entirety?

Admin 5/23/2011

Microsoft says adding < and > should help:

http://support.microsoft.com/kb/171074
Probably this is an Outlook specific trick and won't work if you open email in another email client. Avoiding spaces in URLs is a recommended way.

B
beachldy author 5/23/2011

I tried using "<" and ">". I'm using the built-in ASPR email client for creating messages. Then I'm using Hotmail and other web emails to get messages. Can't help the spaces as it's a link to mapquest and the street address has spaces.
I DID try forwarding the email to outlook, and I had to EDIT the message to get the link to display fully. What I had to do was go to the very end of the hyperlink after the ">" and press ENTER. It then made the link a full one. Not sure why it won't do the hyperlink without a manual return, so that's a pain for a user. The link looks like the one below.
<http://maps.google.com/maps?saddr=111 Main Street, Charleston, SC 29999&daddr=11 Center Street, Folly Beach, SC>

Admin 5/23/2011

ASPRunnerPro doesn't have an email client. It only sends emails through the code. The client email software of the recipient is all what matters. Some email clients would understand hyperlink with space in it, some won't. There is nothing you can do about this in ASPRunnerPro.
Probably you need to switch to HTML format in your emails. Most of email clients would understand that.

B
beachldy author 5/23/2011

I found the replace statement worked as follows:
Dim HLink

Hlink = Replace(Session("DrivingDirections")," ","%20")