473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

System.Web.Mail.SmtpMail problem


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 wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwwwwwwwwwwwwwwwwwwwwwww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ww 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
2 2782
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
5
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to...
2
by: hb | last post by:
Hi, Yesterday I applied an automatic Windows security update from Microsoft. Then, none of my web application can send out email using System.Web.Mail.SmtpMail.Send(); I don't see any errors....
3
by: pmud | last post by:
Hi, I have ab ASP.Net Application in which I need to send e-mail on button click. Even though my C# code for that is correct.I am getting the following error:: I think the following error can be...
3
by: chuckdfoster | last post by:
When using this bit of code, it sends two emails most of the time. Sometimes it doesn't send two, but most of the time it does. I put the system time (Now) in the Subject and each email has a...
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
2
by: Brad | last post by:
I have a web .Net app which sends emails with attachments. After the email is sent I clean up aftermyself and delete the attachments from disk. In upgrading to .Net 2 I changed the email logic...
1
by: Proteus | last post by:
Hi, I have written some very simple code that runs within my website that use system.web.mail to send an email using the SMTP server here. It works fine. However when I alter the code to work...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.