469,594 Members | 2,145 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,594 developers. It's quick & easy.

SmtpMail Problem

Hi everyone. I have i big problem with the SmtpMail class of visual studio
..NET 2003.

Here it is :

I'm sending mail with attachment (1 or more) and if there is an exception
after contacting the SMTP server, i can catch this error in a try catch, but
the mail appear to stuck in the aspnet service (aspnet_wp.exe). What make
me tell that, is the attachment cannot be deleted because of acces
protection.
If a kill the service aspnet_wp.exe in the task manager, the attachment can
be deleted correctly.

So in short, if somebody try to send a mail and there is an exception, the
attachement that the person link with the email are UNDELETABLE until the
aspnet service is restarted...

Thanks in advance, plz answer in the newsgroup,

Arthur
Nov 19 '05 #1
2 1119
Hi Arthur,

This sort of exception is usually caused by a file being opened and not
closed properly. For example, in your code, you may have code that opens or
creates the attachment file, am I right? If an exception occurs, and there
is no try/catch, the code that closes the file will never be executed. You
would put the code that closes the file into the Finally block of a
try/catch block.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.

"Arthur Carré" <yo****@nowheretobefound.com> wrote in message
news:Hrc5e.5596$VF5.5211@edtnps89...
Hi everyone. I have i big problem with the SmtpMail class of visual
studio
.NET 2003.

Here it is :

I'm sending mail with attachment (1 or more) and if there is an exception
after contacting the SMTP server, i can catch this error in a try catch,
but
the mail appear to stuck in the aspnet service (aspnet_wp.exe). What make
me tell that, is the attachment cannot be deleted because of acces
protection.
If a kill the service aspnet_wp.exe in the task manager, the attachment
can
be deleted correctly.

So in short, if somebody try to send a mail and there is an exception, the
attachement that the person link with the email are UNDELETABLE until the
aspnet service is restarted...

Thanks in advance, plz answer in the newsgroup,

Arthur

Nov 19 '05 #2
Arthur, did you ever find a solution to this problem? I am seeing this same
behavior. It looks like SmtpMail isn't cleaning things up when it gets an
exeption.

"Arthur Carré" wrote:
Hi everyone. I have i big problem with the SmtpMail class of visual studio
..NET 2003.

Here it is :

I'm sending mail with attachment (1 or more) and if there is an exception
after contacting the SMTP server, i can catch this error in a try catch, but
the mail appear to stuck in the aspnet service (aspnet_wp.exe). What make
me tell that, is the attachment cannot be deleted because of acces
protection.
If a kill the service aspnet_wp.exe in the task manager, the attachment can
be deleted correctly.

So in short, if somebody try to send a mail and there is an exception, the
attachement that the person link with the email are UNDELETABLE until the
aspnet service is restarted...

Thanks in advance, plz answer in the newsgroup,

Arthur

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Edwin G. Castro | last post: by
8 posts views Thread by Jason | last post: by
2 posts views Thread by Leszek | last post: by
3 posts views Thread by JJBW | last post: by
5 posts views Thread by ElanKathir | last post: by
17 posts views Thread by LACH | last post: by
9 posts views Thread by Russell Stevens | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.