added parameter mail_smtpauthtype to set SMTP authentication type.