473,408 Members | 1,741 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,408 software developers and data experts.

Trying to send mail

Hi,

I am trying to send an email with attachments(these attachments are in
temporary folder) in ASP.NET using classes defined in System.Web.Mail
Namespace.

I dont have SMTP service installed on my machine.
When I invoke "Send" method of SMTPMail class it throws exception and in
"Finally" block I try deleting the temporary folder using
Directory.Delete(path,True).
The "Delete" command throws "System.IO.IOException: The directory is not
empty.".

Can someone please throw some light?
Nov 21 '05 #1
4 993
"Sachin Gusain" <Sachin Gu****@discussions.microsoft.com> schrieb:
"Finally" block I try deleting the temporary folder using
Directory.Delete(path,True).
The "Delete" command throws "System.IO.IOException: The directory is not
empty.".

What's "the temporary folder"?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #2
"Sachin Gusain" <Sachin Gu****@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com...
When I invoke "Send" method of SMTPMail class it throws exception
Maybe you should look to solving this one first ... ? But anyway ...
in "Finally" block I try deleting the temporary folder


Sending an attachment doesn't remove it from your machine!
Even after the Send, the attachments will /still/ be in the temporary
folder - you'll have to delete them yourself.

HTH,
Phill W.
Nov 21 '05 #3
Well, the temporary folder is being created in "c" drive of my machine.
In case "Send" method gives and exception, I am unable to delete the folder
with Directory.Delete method.

"Phill. W" wrote:
"Sachin Gusain" <Sachin Gu****@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com...
When I invoke "Send" method of SMTPMail class it throws exception


Maybe you should look to solving this one first ... ? But anyway ...
in "Finally" block I try deleting the temporary folder


Sending an attachment doesn't remove it from your machine!
Even after the Send, the attachments will /still/ be in the temporary
folder - you'll have to delete them yourself.

HTH,
Phill W.

Nov 21 '05 #4
The temporary folder is being created in "C" drive of my machine.
When "Send" throws an exception, I try to delete the folder in "Finally"
block using "Directory.Delete which again throws the exception preventing me
from deleting the temporary folder.

"Phill. W" wrote:
"Sachin Gusain" <Sachin Gu****@discussions.microsoft.com> wrote in message
news:40**********************************@microsof t.com...
When I invoke "Send" method of SMTPMail class it throws exception


Maybe you should look to solving this one first ... ? But anyway ...
in "Finally" block I try deleting the temporary folder


Sending an attachment doesn't remove it from your machine!
Even after the Send, the attachments will /still/ be in the temporary
folder - you'll have to delete them yourself.

HTH,
Phill W.

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
6
by: DigitalRick | last post by:
I have been running CDONTS in my ASPpages to send emails to me sent from my guestbook. It had been working fine untill I upgraded to Server 2003 (I am also running Exchange 2003) all locally. I...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
2
by: Robert Dufour | last post by:
I tried using (vs2003 Vb.Net) Public Sub SendEmail( _ ByVal Recipient As String, _ ByVal Sender As String, _ ByVal Subject As String, _ ByVal Message As String, _
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
1
by: hmbscully | last post by:
I am trying to send a complex mutli-part email with inline attachments between html pieces. I originally wrote the code in Perl with the MIME::Lite module, which worked fine. My attempts to...
2
by: geter | last post by:
Hello, Im using ASP with VBScript. At some point of the code of the application that Im making some changes, I need to get a confirmation from the user if he wants or not to send a confirmation...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.