generate a PDF and send as attachment