'Bulks Emails not reaching destination, lost in network
I am sending approximately 5000 emails to IIS smtp server Windows 2012 R2 (Server1) using aspose email client (using c#) in a loop. The emails fired queue up in smtp server queue. From that queue, they are all sent to the same destination (an oracle email filing server - Server2).
The problem is - approx 700-800 (randomly every time) emails are getting lost in transit.
Questions - Is there any way that i can queue all the emails received on Server1 to ensure that it is receiving complete 5000 emails? Any setting, so it can receive emails but do not forward them?
Is smtp email delivery not guaranteed to the recipient? Since there is no throttling mechanism, i think i am choking the network by sending large number of emails, and then emails in lost in network. If it is so, is there a mechanism by which smtp server can be configured to process queue slowly. Send out a few and then wait and so on.
Solution 1:[1]
Aspose.Email also let you send the email in the form of bulks as well. Moreover, it is also dependent on server side that how much bulk email it may handle at any given time so as to avoid any bombardment of emails as well. There may be settings on server side. However, from Aspose.Email perspective, you may please consider using following sample code rather than sending via loops. You can divide big chunks of emails into small bulks and then send via Bulk email sending option provided by Aspose.Email.
SmtpClient client = new SmtpClient("mail.server.com", 25, "Username", "Password");
//Create instances of MailMessage class and Specify To, From, Subject and Message
MailMessage message1 = new MailMessage("[email protected]", "[email protected]", "Subject1", "message1, how are you?");
MailMessage message2 = new MailMessage("[email protected]", "[email protected]", "Subject2", "message2, how are you?");
MailMessage message3 = new MailMessage("[email protected]", "[email protected]", "Subject3", "message3, how are you?");
//Create an instance of MailMessageCollection class
MailMessageCollection manyMsg = new MailMessageCollection();
manyMsg.Add(message1);
manyMsg.Add(message2);
manyMsg.Add(message3);
//Use client.BulkSend function to complete the bulk send task
try
{
// Send Message using BulkSend method
client.Send(manyMsg);
Console.WriteLine("Message sent");
}
catch (Exception ex)
{
Trace.WriteLine(ex.ToString());
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Wai Ha Lee |
