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

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 2022
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****@discussions.microsoft.comwrote in message
news:A5**********************************@microsof t.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
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...
2
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...
12
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...
0
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...
0
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 =...
3
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...
6
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...
2
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...
5
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 =...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?

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.