-1

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.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Atin
  • 57
  • 1
  • 8
  • what do you mean lost in transit? do you have some logs or any? – Vijunav Vastivch Apr 02 '19 at 06:05
  • `Is smtp email delivery not guaranteed to the recipient?` Yes, it is not guaranteed. At that kind of volume consider using an ESP like Campaign Monitor or MailGun. Disclaimer: I work for Campaign Monitor. – mjwills Apr 02 '19 at 06:09
  • `If it is so, is there a mechanism by which smtp server can be configured to process queue slowly.` Yes there is (but that would not be an appropriate question for stackoverflow, since it isn't really programming related). But, at your scale, I'd suggest using an ESP or just sending them more slowly to the SMTP server. – mjwills Apr 02 '19 at 06:09
  • @VijunavVastivch, Yes i have logs on client where i am sending, and it says it sent 5000 emails. Regarding logs on server, Server1 has logs, there are no errors in it. I do not have access to Server2 – Atin Apr 02 '19 at 06:13
  • Are you using attachment? or its a plain text? – Vijunav Vastivch Apr 02 '19 at 06:16
  • @VijunavVastivch, there are all types of emails. With/Without attachment, plain text, RTF, HTML – Atin Apr 02 '19 at 06:25

1 Answers1

0

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("msg1@from.com", "msg1@to.com", "Subject1", "message1, how are you?");
MailMessage message2 = new MailMessage("msg1@from.com", "msg2@to.com", "Subject2", "message2, how are you?");
MailMessage message3 = new MailMessage("msg1@from.com", "msg3@to.com", "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());
}
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Mudassir
  • 433
  • 2
  • 7
  • I notice that you have lots of answers related to aspose. Please note that while disclosure of affiliation is generally recommended, it is *absolutely required* when the question you're responding to doesn't specifically mention aspose. – cigien May 10 '22 at 16:27