Firstly, the last thing I would do is to use the Bcc field at all. It serves your purpose as far as hiding the destination addresses, but it does nothing to improve efficiency or speed. In fact if you use the Bcc the whole thing is treated as one email. You could use
Mail::BulkMail but that would require a complete re-write and a new interface to learn. I would suggest the following - still using
MIME::Lite
- Emails should all be 'multipart/mixed' messages. Many servers now 'junk' any email that has nothing but HTML in it.
- Each email should have a 'TEXT' type portion, which can usably point the reader to a link where the email can be read if they have difficulty.
- Because you don't appear to customise the message, y9ou could use the 'pre-prepared part hack' as demerphg calls it in the documentation, you only prepare the MIME part once then you can attach it to as many messages as you like.
- Clustering will help. But with only 4000 addresses, it may not help much.
- Batching emails into groups of 4 or 5, maybe 10 at a time is good, then put in a gap (I usually use 3 seconds) so that you don't flood servers and if you have to work on your web server this will give you a small break to reduce server load.)
jdtoronto