By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

System.Web.Mail.SmtpMail problem

P: n/a

Hi,

I have problem with e-mails which are being send via System.Web.Mail.SmtpMail
class but before describing the problem itself first I'd like to show shortly
what I'm doing on the server.

The following code is being executed on the server to send e-mails to clients
(.NET Framework 1.1):
....
EmailsInQueCollection eqc = GetUnsentEmails();

foreach( EmailInQue email in eqc ) {
System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();

msg.BodyFormat = System.Web.Mail.MailFormat.Html;
msg.To = email.EmailTo
msg.Bcc = email.EmailBcc;
msg.Cc = email.EmailCC;
msg.From = email.EmailFrom;
msg.Subject = email.EmailSubject;
msg.Body = email.EmailBody;

try {
System.Web.Mail.SmtpMail.Send(msg);
} catch {
//logging error info here
....
}
}

....

Everything worked fine when on the server Windows 2000 Server has been installed.
Unfortunately due to some reasons we needed Windows 2003 Server and after
reinstallation a weird problem appeared. E-mails are still being send without
problems (users receive them) but the content of an email is being modified:
after every 992 characters the exclamation character (!) is being added to
the body and then email which the users receive contain not expected characters.
The example of the source e-mail users receive is as follows (sorry for the
long example):

<HTML><HEAD><TITLE>Title goes here</TITLE></HEAD><BODY><TABLE WIDTH=100%
border=0><TR><TD><H1 color=#0350bc>Header goes here</H1><BR><H2>Request To
Do Something</H2></TD></TR></TABLE><TABLE WIDTH=100% border=0><TR><TD>Dear
<b>User</b>,<p>Info data - <b>Details</b>. Please do something blabla</p><p><TABLE
border=1 cellspacing=0 cellpadding=0 bordercolor=#0350bc width=100%><TR><TD><b>
comments:</b></TD></TR><TR><TD><p>test wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwww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wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww!
</p></TD></TR></TABLE><p>Please click this <a href="http://URL to web app">link</a>
to access the page where you can see information blablabla... and enter your
comments.</p><p>If you are using Internet Explorer as your web browser, you
can view the feedback for this blablabla... <a href="http://URL to webbpage">here</a>.</p><p>Thank
you!</p><p>Note: Please do not forward this e-mail to others; they will not
be able to access the!
data.</p></TD></TR></TABLE></BODY></HTML>

This email contains three exclamation characters injected into the body.
Of course such characters don't exist in the original information!
I have found that the characters are injected only if the e-mail format is
set to HTML.

I was curious if the final result is the same on .NET Framework 2.0 so I
have rewritten the code which is responsible for sending emails (using System.Net.Mail.MailMessage
and SmtpClient classes) but the result is the same: exclamation marks are
injected into the e-mail body.

Can you help me solving the problem, please? First of all I've no idea why
the problem appears on Windows 2003 Server system but does not exists on
Windows 2000 Server. The second thing is how to solve the problem: maybe
I need to change the server code somehow, maybe I need to install a patch ...

Please help...

Best regards,
Wojtek

May 14 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Wojtek,

I'm not able to reproduce the issue on my side using simple code and I've
never heard such issue of System.Web.Mail or System.Net.Mail. Would you
please create some reproducible code and send it to me? Thank you for your
effort.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 15 '07 #2

P: n/a
Hi Wojtek,

I hope you understand that without reproducible code, there's really not
much I can help. Please feel free to reply here to re-open this post if you
need to work on it later. Thanks.
Regards,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

May 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.