472,378 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 1173
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Edwin G. Castro | last post by:
I'm using the System.Web.Mail.SmtpMail class to send email from an app I wrote. I needed to install IIS to get it to send the messages even though I wanted to use an existing SMTP server. Anyway, I...
8
by: Jason | last post by:
Hi not sure if this is the write place, but i really need some help with this...! I have a piece of code that sends email using the SmtpMail class, in an ASP.NET web application, with...
2
by: Leszek | last post by:
Hello, I have created a simple code to send emails using the MailMessage class and the SmtpMail.Send() method: MailMessage mail = new MailMessage(); mail.From = echidna@somewhere.com; //...
3
by: JJBW | last post by:
Hi I am having a bit of a problem with SmtpMail. I have a bit of code that should send an email but when it is executed no email turns up. MailMessage mmNotify = new MailMessage(); ...
5
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object†when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object†when I call SmtpMail.Send. This only happens when I send...
17
by: LACH | last post by:
When I sent e-mail from within my asp.net application to Hotmail adresses. The e-mail always end up in Junk e-mail. I sent the e-mail as plain/text. Does anyone know how to solve this?
9
by: Russell Stevens | last post by:
I generate pdf files on my server and allow users to access them via a browser and also email them. Most files work fine whether the user uses his browser or gets an email with a pdf attachment...
19
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.