473,761 Members | 2,384 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SmtpMail causes application to hang...

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
msg.Attachments .Add(New MailAttachment( attachFile))
msg.Subject = subjectString
SmtpMail.SmtpSe rver = mailservername
SmtpMail.Send(m sg)

The message is sent just fine, but then my application refuses to
terminate... when sub Main ends, it just hangs, and a glance at my task
manager shows it to be using ever-increasing amounts of memory, and my
CPU usage shoots up to 100%, and I actually have to kill the
application for it to terminate. This did not start happening until
AFTER I installed the code above...

I see the same behavior whether I explicitly destroy the MailMessage
object or not, whether I reset the mail server name or not...
Any help will be greatly appreciated!

Cheers,
zdrakec

Nov 21 '05 #1
19 3368
I don´t know the asnwer, but most of them related to System.Web.Mail are at:

http://systemwebmail.com/

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
<zd*****@yahoo. com> escribió en el mensaje
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
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
msg.Attachments .Add(New MailAttachment( attachFile))
msg.Subject = subjectString
SmtpMail.SmtpSe rver = mailservername
SmtpMail.Send(m sg)

The message is sent just fine, but then my application refuses to
terminate... when sub Main ends, it just hangs, and a glance at my task
manager shows it to be using ever-increasing amounts of memory, and my
CPU usage shoots up to 100%, and I actually have to kill the
application for it to terminate. This did not start happening until
AFTER I installed the code above...

I see the same behavior whether I explicitly destroy the MailMessage
object or not, whether I reset the mail server name or not...
Any help will be greatly appreciated!

Cheers,
zdrakec

Nov 21 '05 #2
Thanks for the link, but unfortunately, I did not see anything that
addresses this issue there...

zdrakec

Carlos J. Quintero [.NET MVP] wrote:
I don´t know the asnwer, but most of them related to System.Web.Mail are at:
http://systemwebmail.com/


Nov 21 '05 #3
Zdrakec,

This snippet you show now in this newsgroup has been here often.

Mostly is the error that the smtp mailserver is not correct. That is not in
your situation. Therefore in my opinion has it to do with an endless loop
somewhere however not in this snippet.

Just my thought,

Cor
Nov 21 '05 #4
Hello Cor:

Well, this was my first thought, but there IS no loop between the
execution of this code and the exit from Sub Main.In fact, if I step
through execution after the send method call, everything runs just
fine... but after exiting sub Main, the application doesn't terminate.
This ONLY happens if the SmptMail.Send(m sg) is invoked, otherwise
not...

Still puzzled...

Thanks,
zdrakec

Nov 21 '05 #5
Zdrakec,

Have you to test it (not for original) tried a me.close direct after the
send?

Cor
Nov 21 '05 #6
<zd*****@yahoo. com> schrieb;
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
msg.Attachments .Add(New MailAttachment( attachFile))
msg.Subject = subjectString
SmtpMail.SmtpSe rver = mailservername
SmtpMail.Send(m sg)

The message is sent just fine, but then my application refuses to
terminate... when sub Main ends, it just hangs, and a glance at my task
manager shows it to be using ever-increasing amounts of memory, and my
CPU usage shoots up to 100%, and I actually have to kill the
application for it to terminate. This did not start happening until
AFTER I installed the code above...


If you are running virusscanners or firewalls, turn them off temporarily to
be sure that they don't cause the problem.

--
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 #7
Hello Cor, Herfried:

There is no me.close to execute, this is being run from a module, not a
form class object. I turned off my virus scanner and firewall, but with
no change. I point out that the mail message is successfully being
sent!

I tried doing a "threading.thre ad.currentthrea d.abort" command, and
trapping the resulting ThreadAbortExce ption; however, while this does
in fact kill the app, it also gives me that annoying message
"Applicatio n has caused a problem... do you want to create a dump file"
dialog. Since this will end up being an unattended server process, I
can't have a dialog box open! I get this error despite the fact that
the exception is being caught...

More suggestions?

Cheers,
zdrakec

Nov 21 '05 #8
A co-worker had a similar problem. He commented out the line
SmtpMail.SmtpSe rver = mailservername
and SmtpMail worked.

This assumes the PC can send SmtpMail.

He thinks there was some bug in his mailservername value.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:uU******** ******@tk2msftn gp13.phx.gbl...
<zd*****@yahoo. com> schrieb;
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
msg.Attachments .Add(New MailAttachment( attachFile))
msg.Subject = subjectString
SmtpMail.SmtpSe rver = mailservername
SmtpMail.Send(m sg)

The message is sent just fine, but then my application refuses to
terminate... when sub Main ends, it just hangs, and a glance at my task
manager shows it to be using ever-increasing amounts of memory, and my
CPU usage shoots up to 100%, and I actually have to kill the
application for it to terminate. This did not start happening until
AFTER I installed the code above...
If you are running virusscanners or firewalls, turn them off temporarily

to be sure that they don't cause the problem.

--
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 #9
Hello Bill:

Well, yes, when I comment that out, the problem goes away. However, the
message also does not get sent! This is why I tried resetting this to
an empty string after the send call, thus:

msg.Attachments .Clear()
msg = Nothing
SmtpMail.SmtpSe rver = ""

Thanks though!

More?

Cheers,
zdrakec

Nov 21 '05 #10

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

Similar topics

8
379
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 integrated window authentication. it does work, and works fine on my dev machine. it also works fine on the test server, but with some considerations. on the test server, i can send emails IF they do not include any attachments. as soon as i send an email...
1
2699
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
3
9256
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 e-mail addresses out side my company walls. When the e-mail is send on some one in my company it works perfect. I think it is a relay issue. Our system administrator will not allow relaying. In the ASP.Net web.config file I let the web application...
4
7552
by: Aren Cambre | last post by:
Why does SmtpMail.Send throw an exception if the MailMessage's BodyFormat = MailFormat.Html? I've searched all over the place and cannot find a solution anywhere. I am running this on Windows XP SP2, and IIS's SMTP and WWW servers are installed. Here is the error trace: System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an...
0
1830
by: Eric van Wijk | last post by:
Hi All, After installing SP1 for Windows 2003, I'm running into the 'Error loading type library/DLL' exception when using CDO through System.Web.Mail: ------------------------------------------- //try { // security assertion
1
1124
by: ra294 | last post by:
Hi, I have a web application that sends Email on certain events. The problem is that sometimes the local mail server does not response to SmtpMail.Send and all the web application in stucked so the user can not browse anymore. I thought that a possible solution is to send the Email in new thread so the application will continue to work also when the mail server is down. What's the easiest way to accomplish this ? Anyone has an example...
2
1700
by: H. Blijlevens | last post by:
Hi y'all! I'm trying to adapt a VB.Net application that a former employee built to keep track of product issues that our customers report. While doing so, I bump into the following problem: a textbox contained in a user control that's put on a MDI Child form causes the application to hang as soon as you hit the Delete key while editing. Everything freezes and only Ctrl + Esc or Ctrl + Alt + Delete will bring things back to life.
0
993
by: Nathan Truhan | last post by:
Hello, I have a WinForms application to send out emails to a large group of students. This is not spam, but mail from our university to the students. Currentl I have a ListView with 4 columns Email, FirstName, MiddleName, LastName. I also have a form that will load users into this listview from a number of different places defined by ODBC. The population of this listview works perfectly, however with a small number of users, the...
17
6431
by: OlafMeding | last post by:
Below are 2 files that isolate the problem. Note, both programs hang (stop responding) with hyper-threading turned on (a BIOS setting), but work as expected with hyper-threading turned off. Note, the Windows task manager shows 2 CPUs on the Performance tab with hyper-threading is turned on. Both Python 2.3.5 and 2.4.3 (downloaded from python.org) have this problem. The operating system is MS Windows XP Professional.
0
9336
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8770
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7327
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.