Added record_sent_mail function

Writes a record indicating that a mailing has been sent to a specific
email address. This will ensure avoiding duplication of sent emails.
Also added *.db to .gitignore.