0

I developed a paging application to send emails and text messages to our users. We want to be able to create a hyperlink within the message that points to a specific email message on our company SMTP server.

I can send a text message that creates a link to Outlook doing this: https://mail.domain.com. We want to create a link to a specific email message.

I found instructions to do this in a couple of ways. They are:

Link: Outlook:Inbox/~Subject (surrounded by <>) or Link: Outlook:'GUID' (surrounded by <>)

But they are giving me the error message: ASP.NET has detected data in the request that is potentially dangerous because it might include HTML markup or script.

Can anyone direct me on how to create a link to a specific email message on our SMTP Outlook server?

Thanks.

UPDATE I can send the text message but the link is not displayed as a link but text. This is my email body string that can be texted to my cell phone but the link does not go to the email defined. I tried just creating the Outlook link like this:

string test = "<Outlook:Inbox//~New Provider>";
 EmailInfo.Message = HttpUtility.HtmlEncode(test);

I also tried creating a link using href:

string test = "<a href=\"<Outlook:Inbox//~New Provider>\">Email Link</a>";
EmailInfo.Message = HttpUtility.HtmlEncode(test);

Both successfully sent a text message to my phone. But I could not click on the links. They were displayed as text like this: MSG:<a href="<Outlook:Inbox//~New Provider>">Email Link</a>

Why is the link displayed as plain text?

Gloria Santin
  • 2,066
  • 3
  • 51
  • 124
  • It might allow you to proceed if you convert the angle brackets to their alternate identities, namely ">" for ">" and "<" for "<" – B. Clay Shannon-B. Crow Raven Dec 08 '15 at 21:48
  • You have to turn off validation to post angle brackets `< >`. Depending upon what version of ASP.NET you're using [there's a bunch of answers here](http://stackoverflow.com/questions/81991/a-potentially-dangerous-request-form-value-was-detected-from-the-client) to turn off validation. Another option might be to not put the `< >` in the link and programmatically add them after the post when you see the `Outlook:` prefix. – ourmandave Dec 09 '15 at 03:13
  • Thanks for the help. I will try to get it to work using your suggestions. – Gloria Santin Dec 09 '15 at 14:18
  • I tried a couple of things that I describe above. The text is successfully sent but the link is in plain text and not clickable. – Gloria Santin Dec 09 '15 at 15:57
  • @GloriaSantin Well, it doesn't [look](http://stackoverflow.com/questions/6500137/how-do-i-add-a-hyperlink-in-sms-message-in-android-phone?lq=1) [promising](http://stackoverflow.com/a/3582273/3585500). I was going to suggest going the other direction and creating a link in a message from your phone and sending it to your email address. Then you could see what format it's using. – ourmandave Dec 09 '15 at 21:11
  • I can create a link to Outlook Web Access but not to a specific email message. – Gloria Santin Dec 09 '15 at 21:24
  • I think sms clients automatically create a link when they see `http://` or `ftp://` in a text but ignore anything else like `Outlook:`. I saw some ideas to use bitly.com or TinyURL.com but they won't take a url that doesn't start with http or ftp. In theory you could [make your own URL shortener](http://lifehacker.com/5335216/make-your-own-url-shortening-service) and send `http` links that way. – ourmandave Dec 09 '15 at 23:11
  • I don't see how a URL shortener solves the problem. Wouldn't I have to convert the Outlook: string to an http link? How could I do that? – Gloria Santin Dec 10 '15 at 13:57
  • @GloriaSantin With your own shortener server you could make `http://myShortener.com/whatever` a link to `` and send that `http` link. – ourmandave Dec 10 '15 at 14:55
  • Oh...I see (said the blind man to his deaf brother). I don't know if getting our own shortener server is doable. I must look into that. – Gloria Santin Dec 10 '15 at 16:18

0 Answers0