Max number of keywords. Mailing attachments with separate function.

Max 1000 keywords, sends error message if more.
Separate function for mailing attachments (possibly merging back into
one).