Updated for SMTP/JSON