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.
| [reply] [d/l] |
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
| [reply] |