I'm new to posting issues online, so bare with me...
Does anyone have any clues on this:
I have an application that is set to run as a service and it sends an
email if an error is encountered. The emailing part seems to work fine
- no errors, except that the emails don't get sent until the
application/service is exited. As soon as I quite the application, the
emails are sent and arrive in my inbox. I need the emails to be sent
without having to shutdown the application. Any clues? Could I be
missing something? Some object that needs to be destroyed?
I'm using the CDO object to generate emails. 7 1451
On Mar 23, 10:59 am, merzi...@gmail. com wrote:
I'm new to posting issues online, so bare with me...
Does anyone have any clues on this:
I have an application that is set to run as a service and it sends an
email if an error is encountered. The emailing part seems to work fine
- no errors, except that the emails don't get sent until the
application/service is exited. As soon as I quite the application, the
emails are sent and arrive in my inbox. I need the emails to be sent
without having to shutdown the application. Any clues? Could I be
missing something? Some object that needs to be destroyed?
I'm using the CDO object to generate emails.
Could you please post some of your sending code?
- The strToList is an array of email addresses.
Public Shared Sub SendMail_CDO(By Val strFrom As String, ByVal
strToList() As String, ByVal subject As String, ByVal body As String)
Const Source As String = "Config.SendMai l_CDO"
Dim iConf As New CDO.Configurati on
Dim Flds As ADODB.Fields
Flds = iConf.Fields
Flds(CDO.CdoCon figuration.cdoS endUsingMethod) .Value =
CDO.CdoSendUsin g.cdoSendUsingP ort
Flds(CDO.CdoCon figuration.cdoS MTPServer).Valu e =
Config.SmtpServ er
Flds(CDO.CdoCon figuration.cdoS MTPServerPort). Value = 25
Flds(CDO.CdoCon figuration.cdoS MTPAuthenticate ).Value =
CDO.CdoProtocol sAuthentication .cdoAnonymous.c doAnonymous
Flds.Update()
Dim strTo As String
Try
For i As Int32 = 0 To strToList.Lengt h - 1
Dim iMsg As New CDO.Message
iMsg.Configurat ion = iConf
strTo = strToList(i).Tr im
iMsg.From = strFrom
iMsg.To = strTo
iMsg.Subject = subject
iMsg.TextBody = body
Trace.WriteTrac e("Sending Email to " + strToList(i))
iMsg.Send()
Trace.WriteTrac e("Sent Email to " + strToList(i))
Next
Catch ex As Exception
End Try
End Sub
Does this help, or do you you need some more context?
Is there any particular reason you're not using CDONTS? Is that old school?
That's what I used in VB6 and it worked like a charm. If you're interested,
post back and I'll post my code.
Robin S.
-----------------------------
<me******@gmail .comwrote in message
news:11******** *************@e 1g2000hsg.googl egroups.com...
>- The strToList is an array of email addresses.
Public Shared Sub SendMail_CDO(By Val strFrom As String, ByVal
strToList() As String, ByVal subject As String, ByVal body As String)
Const Source As String = "Config.SendMai l_CDO"
Dim iConf As New CDO.Configurati on
Dim Flds As ADODB.Fields
Flds = iConf.Fields
Flds(CDO.CdoCon figuration.cdoS endUsingMethod) .Value =
CDO.CdoSendUsin g.cdoSendUsingP ort
Flds(CDO.CdoCon figuration.cdoS MTPServer).Valu e =
Config.SmtpServ er
Flds(CDO.CdoCon figuration.cdoS MTPServerPort). Value = 25
Flds(CDO.CdoCon figuration.cdoS MTPAuthenticate ).Value =
CDO.CdoProtocol sAuthentication .cdoAnonymous.c doAnonymous
Flds.Update()
Dim strTo As String
Try
For i As Int32 = 0 To strToList.Lengt h - 1
Dim iMsg As New CDO.Message
iMsg.Configurat ion = iConf
strTo = strToList(i).Tr im
iMsg.From = strFrom
iMsg.To = strTo
iMsg.Subject = subject
iMsg.TextBody = body
Trace.WriteTrac e("Sending Email to " + strToList(i))
iMsg.Send()
Trace.WriteTrac e("Sent Email to " + strToList(i))
Next
Catch ex As Exception
End Try
End Sub
Does this help, or do you you need some more context?
Better yet, is there any reason you're not using the framework's SMTP mail
classes. There is one mail class in the web section and a newer one in the
general system namespace in .NET 2.0. Both these classes use CDO
underneath.
Mike Ober.
"RobinS" <Ro****@NoSpam. yah.nonewrote in message
news:OI******** *************** *******@comcast .com...
Is there any particular reason you're not using CDONTS? Is that old
school? That's what I used in VB6 and it worked like a charm. If you're
interested, post back and I'll post my code.
Robin S.
-----------------------------
<me******@gmail .comwrote in message
news:11******** *************@e 1g2000hsg.googl egroups.com...
>>- The strToList is an array of email addresses.
Public Shared Sub SendMail_CDO(By Val strFrom As String, ByVal strToList() As String, ByVal subject As String, ByVal body As String) Const Source As String = "Config.SendMai l_CDO" Dim iConf As New CDO.Configurati on Dim Flds As ADODB.Fields
Flds = iConf.Fields Flds(CDO.CdoCon figuration.cdoS endUsingMethod) .Value = CDO.CdoSendUsi ng.cdoSendUsing Port Flds(CDO.CdoCon figuration.cdoS MTPServer).Valu e = Config.SmtpSer ver Flds(CDO.CdoCon figuration.cdoS MTPServerPort). Value = 25 Flds(CDO.CdoCon figuration.cdoS MTPAuthenticate ).Value = CDO.CdoProtoco lsAuthenticatio n.cdoAnonymous. cdoAnonymous Flds.Update()
Dim strTo As String
Try For i As Int32 = 0 To strToList.Lengt h - 1 Dim iMsg As New CDO.Message iMsg.Configurat ion = iConf strTo = strToList(i).Tr im
iMsg.From = strFrom iMsg.To = strTo iMsg.Subject = subject iMsg.TextBody = body
Trace.WriteTrac e("Sending Email to " + strToList(i)) iMsg.Send() Trace.WriteTrac e("Sent Email to " + strToList(i)) Next
Catch ex As Exception
End Try End Sub
Does this help, or do you you need some more context?
You need to rewrite your email sending library.
You can get some ideas here.
(1.1 and 2.0 downloadable code)
2/8/2006
Smarter Email/Smtp setup with DotNet Configuration Sections (1.1 and 2.0) http://sholliday.spaces.live.com/blog/
<me******@gmail .comwrote in message
news:11******** **************@ e65g2000hsc.goo glegroups.com.. .
I'm new to posting issues online, so bare with me...
Does anyone have any clues on this:
I have an application that is set to run as a service and it sends an
email if an error is encountered. The emailing part seems to work fine
- no errors, except that the emails don't get sent until the
application/service is exited. As soon as I quite the application, the
emails are sent and arrive in my inbox. I need the emails to be sent
without having to shutdown the application. Any clues? Could I be
missing something? Some object that needs to be destroyed?
I'm using the CDO object to generate emails.
Frequently Asked Questions for System.Net.Mail
2.0 - http://www.systemnetmail.com/
Frequently Asked Questions for System.Web.Mail
1.1 - http://www.systemwebmail.com/
I'm new to posting issues online, so bare with me...
Does anyone have any clues on this:
I have an application that is set to run as a service and it sends an
email if an error is encountered. The emailing part seems to work fine
- no errors, except that the emails don't get sent until the
application/service is exited. As soon as I quite the application, the
emails are sent and arrive in my inbox. I need the emails to be sent
without having to shutdown the application. Any clues? Could I be
missing something? Some object that needs to be destroyed?
I'm using the CDO object to generate emails. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Joey |
last post by:
I am currently developing a C# asp.net application where users are
required to register. The application then generates a simple, plain
text email and sends it to the new user.
I have been trying to use the MailMessage and SmtpMail classes from the
System.Web.Mail namespace (built in to .net) to do this. It is my
understanding that these classes use CDONTS (cdosys.dll) and the SMTP
mail service on the server to send the messages....
|
by: horsetransport |
last post by:
Hello,
Below is what I "Know how to do" but it doesn't accomplish what I want
I have table called sndmail fields that matter useremail and mailsent
|
by: manevski ognjen |
last post by:
Hi,
I have one problem with console application and threading.
In my SMtp class I have method that sends emmails with attachments
with html
text. Program should work with, let say 10 emails, and everyone of
them is different. If i send file of 2Mb html data, the other files in
other emails
should be sent asynchrony with that file. But my program does not work
very well. when I put mmain Thread to sleep, everything works just
|
by: phpuser123 |
last post by:
I have visited various sites n when I log in,there is an option
"remember me"
I want to know how this works....Do they use a cookie for this task.....
I usually put time()+3600 for it to expire one hour later ...What should I put as the expiration date such that it remembers me till the next time I log in?
The syntax of the coookie is :
setcookie(name,value,expire,path,domain,secure)
|
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...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
|
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...
|
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();...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |