Solved

Hyperlink in email sent via .NET not wrapping when read as text

Posted on 2006-12-01
4
360 Views
Last Modified: 2010-04-23
I am sending out batch emails via MailMessage in VB.NET and picking the email addresses from a databse.

The body of the Email is sent out via MailFormat.Html

I have a hyperlink in the message eg <a href="http://www.XXXXXXXXXXXXXXX">Click here</a>

The problem is that the hyperlink is about 150 characters long. If the receiver of the email views their messages in HTML the link works OK but if they view their Emails as text then the link spills over at least 2 lines and only the first line is underlined so therefore when they clck on the link it does not work as the full url is not being picked up.

Are there some extra tags I need to place in the HTML document so as that this does not happen?

0
Comment
Question by:gmbeckett
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 500 total points
ID: 18052605
Hi gmbeckett,

There isn't much you can do to be honest. If the message is read as plain text then it is entirely up to the email software to handle this and has nothing to do with the html tags you may embed. For instance Microsoft Outlook has a default which splits lines at (I think) 77 characters in length. This is what is causing your problem. You can only do what many websites do in this situation and put a comment in there to the effect that if the url is split over many lines it should be copied out and manually entered into a browser. Whilst this is not ideal it is the best you can do.

Tim Cottee
0
 

Author Comment

by:gmbeckett
ID: 18052734
How is then that other emails I receive in HTML but viewed as text the link does carry over 2 lines
0
 

Author Comment

by:gmbeckett
ID: 18384514
I did have a soulution to this problem in that I created a separate aspx web page just called Em.aspx
In this page I passed just a one character string.
Depending on what character was submitted then the coding behind would redirect to whatever page was required.

eg 'A' would be directed to a certain page and 'B' would be directed to another page.

This way I kept the hyperlink to less than about 50 characters
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question