Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now