Made SMTP support more robust.