473,698 Members | 2,551 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error reporting with SmtpMail.Send()

I want to add guaranteed delivery (or at least guarantee sent) to some code
using SmtpMail.Send() . The method is void. Does Send() throw exceptions if
it cannot connect to the Smtp server or has some other error?

I could then store the message on an MSMQ and retry later. What do you
think of this design?
Nov 21 '06 #1
3 2035
Hi,

Mail certainly isn't guaranteed delivery, even if Send returns without an
error.

If you have the ability to use MSMQ immediately, that might be a better
approach.

--
Dave Sexton

"plex4r" <pl****@discuss ions.microsoft. comwrote in message
news:A5******** *************** ***********@mic rosoft.com...
>I want to add guaranteed delivery (or at least guarantee sent) to some code
using SmtpMail.Send() . The method is void. Does Send() throw exceptions
if
it cannot connect to the Smtp server or has some other error?

I could then store the message on an MSMQ and retry later. What do you
think of this design?

Nov 21 '06 #2
Hi,

SmtpMail.Send() will throw exception if having problems in connecting to the
mail server/ having problems in sending the mail... To find out the exception
types, check http://msdn2.microsoft.com/en-us/library/9b46af9f.aspx -
Exceptions.

So, if there is an exception, you should store it somewhere and resend it
later.

Cheers,
Chester

"plex4r" wrote:
I want to add guaranteed delivery (or at least guarantee sent) to some code
using SmtpMail.Send() . The method is void. Does Send() throw exceptions if
it cannot connect to the Smtp server or has some other error?

I could then store the message on an MSMQ and retry later. What do you
think of this design?
Nov 22 '06 #3
Thanks for the info. this is just what I needed.

"Chester" wrote:
Hi,

SmtpMail.Send() will throw exception if having problems in connecting to the
mail server/ having problems in sending the mail... To find out the exception
types, check http://msdn2.microsoft.com/en-us/library/9b46af9f.aspx -
Exceptions.

So, if there is an exception, you should store it somewhere and resend it
later.

Cheers,
Chester

"plex4r" wrote:
I want to add guaranteed delivery (or at least guarantee sent) to some code
using SmtpMail.Send() . The method is void. Does Send() throw exceptions if
it cannot connect to the Smtp server or has some other error?

I could then store the message on an MSMQ and retry later. What do you
think of this design?
Nov 22 '06 #4

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

Similar topics

3
1634
by: Nader | last post by:
Hello all, Any help would be greatly appreciated. In a Web-based application (server is local) I am trying to send an email from the server side by The error occurs at the following line while trying to send an email from the server: SmtpMail.Send(msgMail);
2
91061
by: Janna Deegan | last post by:
Hello all, First off, if there is a better place to post for an answer to this question, please feel free to point me there. I have some very strange behavior happening with my System.web.mail objects. I was able to run my application fine for roughly 1500 email messages. The next time I tried sending mail, it stopped working with the message: "
12
10365
by: James Lankford | last post by:
Hello group: I have reached the end of my rope with this error. I have pretty much tried every suggestion I've found thus far and I get this error no matter what I do. I did try using the CDOSYS test from Microsoft as a test for the smtpserver, and it'll send that way. Here's my existing code: Public Sub SendMail() Dim myMailMsg As New Mail.MailMessage()
0
1125
by: Chris Lane | last post by:
I am getting the following error when trying to send the mail object: COMException (0x80040213): The transport failed to connect to the server. ] System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object args, Boolean byrefModifiers, Int32 culture, String
0
2529
by: Erwan | last post by:
I have a strange (but very blocking) result when using the smtpmail class from an ASPX page : here is the (very simple !) code... '-------------------------------------------------- mail.To = "el@illico.fr" mail.From = "el@illico.fr" mail.Subject = "test envoi de mail" mail.Body = "test envoi de mail"
3
1543
by: Nick Brown | last post by:
Has any1 else had this error message. If so how do u solve it? The specified module could not be found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.FileNotFoundException: The specified module could not be found. Source Error:
6
1661
by: Alixx Skevington | last post by:
OK why does the following code work in a Windows form with a crystal report viewer but not in a webform. I get the usual CrystalReports.EngineLogONException logon Failed when this is called in aspx. Any help will be very much apprecaited Alixx This is the code in the calling aspx Page
2
2012
by: Wayne Wengert | last post by:
I have an aspx page in which I step through emails from a SQL Server table and snd each a custom email message. The emails in that table are all valid formats. When I run the page I immediately get the following error message: ---------------------------------- Exception Details: System.Runtime.InteropServices.COMException: The server rejected one or more recipient addresses. The server response was: 501 5.5.4 Invalid Address...
5
2492
by: Nathan Sokalski | last post by:
I am attempting to send an email using ASP.NET 1.1's Mail.SmtpMail.Send() method. My code contains all of the following: Dim mailmsg As New Mail.MailMessage Mail.SmtpMail.SmtpServer = System.Configuration.ConfigurationSettings.AppSettings("smtpserver") mailmsg.BodyFormat = Mail.MailFormat.Text mailmsg.Subject = "My Subject"
0
8680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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
9169
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
7738
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
6528
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
5861
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
4622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
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
2007
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.