Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: To Queue or not to queue Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
billymac
Newbie
Newbie
Avatar

Joined: 29 September 2014
Location: Canada
Online Status: Offline
Posts: 5
Posted: 19 October 2014 at 6:11pm | IP Logged Quote billymac

I just (mostly) completed converting my mailbee code from sending emails in a loop to using the datatable and mail merge approach.
It is creating the eml files just fine, just needs some tweaking...
But I just thought...
What is the advantage of doing it that way?
Yes, the sending to pickup folder definitely makes sense and I will continue to do that instead of sending each email directly, but after spending a fair bit of time writing the code to create the method to dynamically create the datatable that the mail merge needs, I realized its much easier to just do it the old way which was to read my template file and search and replace the template fields with the values for each email, and then send the email to the pickup folder.

Are there any other advantages of continuing to use the datatable approach that I didn't think of?
The search and replace way is much less code and easier to debug.
Back to Top View billymac's Profile Search for other posts by billymac
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 22 October 2014 at 3:40am | IP Logged Quote Alex

Most folks already have database so for them it's easier to process mail merge over their existing db. If you don't have db, you can safely create mails manually.

DB approach may provide some benefits in case when emails are sent to SMTP server rather than to pickup folder due to less memory consumption. I.e. if you add 1000 emails to the queue for effective sending in multi-threaded mode, it will take nearly 1000 times more memory than adding 1 message and db indices (which are just integer numbers). But submitting to a pickup folder is not multi-threaded (multi-threading obviously does not make sense there) and each message is processed separately.

I.e. submitting single messages to the pickup folder 1000 times will take the same time as submitting a batch of 1000 messages there (while sending 1000 individual emails to SMTP will be much slower than sending a batch of 1000 emails with multi-threading and multiple sendings per SMTP session).

Just make sure you never have multiple instances of mail messages in the memory at the same time to keep memory footprint low. As you're processing them one-by-one, this seems to be your case, and things are fine this way.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide