Have a .NET program that uses the System.Net.Main namespace to send an email via SMTP.
Its on a customers site so from there it will go via a (series of?) SMTP relay servers before it reaches its destination.
At the moment I have no information about this smtp replay / email infrastructure (and getting that information is going to be hard).
Somewhere along the line an exclamation mark is being inserted into long URL's in the the email around 100 chars in from the start of a line.
EDIT- Actually have found its about 1000 chars in
This is not happening on a test system or hundreds of other sites.
I feel sure this has to be something to do with escape codes to break long lines up.
Anyone got any ideas?
Got hit with this myself.
If you are building a html message without any carriage returns in it, you may get errors somewhere around the 1000 character mark.
Solution is to add a few \r\n characters so that each line is smaller than 1000 (or 988 if you don't count the \r\n characters).
See section 2.1.1. Line Length Limits of RFC 2822 for more details:
Wrapping at a certain number of characters is usually a client issue. If you're not seeing it at your other sites, or on a test machine I don't think its your code. See if you can't find out what client is being used to receive the message-it could be some crufty old thing thats auto wrapping at a certain number of characters.
It does not sound like the .Net app is causing the issue if the problem is not happening on many other sites where the same code is running. Is the problem site behind some kind of application firewall or anti-spam device that might be monitoring the smtp stream? If so, there might be a rule about truncating long URLs that is being triggered which then causes the URLs in the email to be shortened.