Simply subclass SMTPHandler in order to produce the wanted behavior.
you could for example override the emit method in order to send a mail on every third logged message
Caution: Depending on the implementation you chose no mail at all would be sent if you do log only one or two times. Perhaps a delayed sending could be the solution: Wait a second before you send the mail. If after a second no other line is received, then send it else add the line to the message to be send and wait another second ... and so on... (Delayed sending must be done in a separate thread (consider using Timer)