M
Mike Senkpiel
I have stumbled accross an odd issue while sending an email
programmatically from VS 2005. The following code is what I use to
reproduce the problem from a console app.
using System.Net.Mail;
static void Main(string[] args)
{
StringBuilder body = new StringBuilder();
body.AppendLine("1. Enable Midsession Level 1 Maintenance");
body.AppendLine("2. Enable Midsession Level 2 Maintenance");
body.AppendLine("3. Enable Midsession Level 3 Maintenance");
MailMessage email = new MailMessage("(e-mail address removed)",
"(e-mail address removed)", "Test", body.ToString());
new SmtpClient("smtprelay.whatever.com").Send(email);
}
This code results in the following email body.
1. Enable Midsession Level 1 Maintenance 2. Enable Midsession Level
2 Maintenance 3. Enable Midsession Level 3 Maintenance
But if any character is removed from the first line, e.g. "1. Enable
Midsession Level 1 Maintenanc", the result is:
1. Enable Midsession Level 1 Maintenanc
2. Enable Midsession Level 2 Maintenance 3. Enable Midsession Level
3 Maintenance
Same for the second line (now "1. Enable Midsession Level 1
Maintenanc" and "2. Enable Midsession Level 2 Maintenanc"):
1. Enable Midsession Level 1 Maintenanc
2. Enable Midsession Level 2 Maintenanc
3. Enable Midsession Level 3 Maintenance
There appears to be a 39 charcter limit before the unexpected behavior
occurs.
Can anyone reporoduce and/or explain this behavior?
Thanks,
Mike
programmatically from VS 2005. The following code is what I use to
reproduce the problem from a console app.
using System.Net.Mail;
static void Main(string[] args)
{
StringBuilder body = new StringBuilder();
body.AppendLine("1. Enable Midsession Level 1 Maintenance");
body.AppendLine("2. Enable Midsession Level 2 Maintenance");
body.AppendLine("3. Enable Midsession Level 3 Maintenance");
MailMessage email = new MailMessage("(e-mail address removed)",
"(e-mail address removed)", "Test", body.ToString());
new SmtpClient("smtprelay.whatever.com").Send(email);
}
This code results in the following email body.
1. Enable Midsession Level 1 Maintenance 2. Enable Midsession Level
2 Maintenance 3. Enable Midsession Level 3 Maintenance
But if any character is removed from the first line, e.g. "1. Enable
Midsession Level 1 Maintenanc", the result is:
1. Enable Midsession Level 1 Maintenanc
2. Enable Midsession Level 2 Maintenance 3. Enable Midsession Level
3 Maintenance
Same for the second line (now "1. Enable Midsession Level 1
Maintenanc" and "2. Enable Midsession Level 2 Maintenanc"):
1. Enable Midsession Level 1 Maintenanc
2. Enable Midsession Level 2 Maintenanc
3. Enable Midsession Level 3 Maintenance
There appears to be a 39 charcter limit before the unexpected behavior
occurs.
Can anyone reporoduce and/or explain this behavior?
Thanks,
Mike