Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

broken hyper link in email 1

Status
Not open for further replies.

garygruber

Programmer
Jan 11, 2006
7
US
i am using SMTP and System.Web.Mail to create email notifications for users when reports are generated. the messages contain a hyperlink to a network folder. the folder name contains a blank space ASC(20) in it.

i am sure this is a common problem but have not found a viable solution yet to fixing the broken link.

complete link:
\\msgcli1p1v\LO File Store\Reporting\Disbursement\2006\09\20

only this is shown as a hyperlink:
\\msgcli1p1v\LO

how do i handle the space char?
 
my guess is because of the link. Are you surrounding the link with single quotes?
 
i have tried both single and double quotes. neither work.

thanks for your interest.
 
Try passing that link string as:
Code:
string lnk = @"\\msgcli1p1v\LO File Store\Reporting\Disbursement\2006\09\20"

Sharing the best from my side...

--Prashant--
 
it is already resolving itself to that format in the debugger.

thanks anyway...
 
Have you tried Server.UrlEncode to try to make the link something more palletable? If it is going to an email client, it should be able to process that link.

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
if the question you're asking is "how do i get my smtp client to accept that hyperlinks in text documents can contain spaces" then the answer is you can't.

rename the network share without spaces.

or use html/rtf/word formatting for your emails.



mr s. <;)

 
Forgive my spelling of palatable.

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
sorry, but i am not the head of the dept. in this 12 billion dollar company. so i cannot rename a network share.
 
You don't rename the share. You Url Encode it in code.
Code:
string lnk = Server.UrlEncode("\\\\msgcli1p1v\\LO File Store\\Reporting\\Disbursement\\2006\\09\\20");

Then use lnk like you need to. That was my suggestion.

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
you can urlencode all you want, but if your users use outlook or outlook express as an SMTP client, it won't allow spaces in a unc sharename: the encoding just doesn't work, and neither "+" nor "%20" will make windows navigate to the correct folder.

i'd be really glad to be proved wrong because i've been trying to find a workaround for a while. the only way i've found is to use html.



mr s. <;)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top