Added error handling for attachments > 5 MB