SmtpStopJobsOnError Property
Gets or sets if processing of the jobs must be stopped if an error occurs.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
public bool StopJobsOnError { get; set; }

Property Value

Type: Boolean
true if processing of the jobs (sending e-mails or submitting them to the pickup folder) must be stopped whenever an error which prevents an e-mail from being sent or submitted to the pickup folder occurs; false if processing of the jobs must continue regardless of any errors. The default value is false.

This property allows the developer to control whether jobs processing should be stopped if an error occurs, or this error will be skipped and the jobs processing will be continued.

StopJobsOnError mode must be set BEFORE calling a method which would start to process jobs (such as SendJobs or SubmitJobsToPickupFolder(String, Boolean)).

Note Note
If StopJobsOnError is true, failure to send even a single e-mail will stop the entire process. The particular e-mail which could not be sent (or submitted to the pickup folder) will be returned to the pending queue. It's possible to resume the stopped process by calling SendJobs method (or SubmitJobsToPickupFolder(String, Boolean) in the case of submitting to the pickup folder).

In practice, most applications set StopJobsOnError to false when sending e-mails because it's usually normal that some messages (e.g. 5 from 10000) could not be sent. However, when submitting e-mails to the pickup folder rather than sending them, the applications usually set StopJobsOnError to true. This is because submitting to the pickup folder is much more reliable operation than sending out. Usually, if an error occurs during submitting to the pickup folder, this means the disk is full. It's required to free some space before the application can continue.

The developer can also leave StopJobsOnError set to false and stop processing jobs manually using StopJobs method. For instance, the developer can use MessageSent and MessageNotSent event to keep track of successful and failed messages and call StopJobs if number of messages failed one after another exceeded certain threshold. Thus, the application will tolerate random failures but stop sending process completely if failures become systematic.

See Also