Solved

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

Posted on 2006-12-01
4
359 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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
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 …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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