njweatherman has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I have an email script that runs on my local computer. Every day, we use this script to send out customized emails to our clients. On average, the script sends out about 25 - 75 emails at a clip. Each email gets attached to it a unique Microsoft Word document. The script uses Net::SMTP and Mime::Lite for modules. Before our web server host switched to smtp authentication, the email program would finish sending out all the emails within a few minutes. When our web hosting company switched to smtp authentication, the program has slowed considerably because every email that is sent, the server wants to check for authentication. My question is is there a way for the perl program to just check for authentication on the first email being sent from the group, while the others are sent without authentication?

Replies are listed 'Best First'.
Re: Speeding Up SMTP Authentication
by MidLifeXis (Monsignor) on Mar 20, 2008 at 17:02 UTC

    Not seeing your code, I can only guess (see How do I post a question effectively?).

    That being said, however, I would guess that you are making a separate connection to the SMTP server each time. If that is happening, see if your client can place multiple messages on the connection, and also see if your server will accept multiple messages on a single connection. Look where quit() is called, for example.

    --MidLifeXis

Re: Speeding Up SMTP Authentication
by dwm042 (Priest) on Mar 20, 2008 at 17:11 UTC
    The problem is that your perl program isn't doing the authentication checking, the SMTP server is doing the checking. Therefore, your perl program doesn't have any control over that aspect.

    You *may*, however, be able to send multiple emails in a single SMTP session, which could reduce your authentication requirements. YMMV