Added optional max_messages parameter to the engine send_all() function.
Can be used to limit the number of messages sent for the current SMTP connection.