SendMail
Introduction and overview
The SendMail AuthState is a generic AuthState to send e-mails.
Description
The following table and chapters describe the characteristics of the AuthState.
Topic | Description |
---|---|
Class | ch.nevis.esauth.auth.states.mail.SendMail |
Logging | StdStates |
Auditing | none |
Marker | none |
Methods | process (all events) |
Properties
mail.*
(string, -)Properties starting with the prefix mail. are propagated to the SMTP Client. In case the
mail.transport.protocol
is not provided nevisAuth usesmtps
as default.SOCKS ProxiesSendMail supports SOCKS proxies as described in chapter Configuring proxies.
smtpUser
(string, -)The user used for authentication on the SMTP server.
smtpPass
(string, -)The passphrase used for authentication on the SMTP server.
subject
(string, -)The subject of the e-mail. Expressions will be substituted during the request.
body
(string, -)The body of the e-mail. Expressions will be substituted during the request.
sender
(string, -)The sender of the e-mail. Expressions will be substituted during the request..
receivers
(string, -)Comma-, semicolon- or space-separated list of receivers. Expressions will be substituted during the request.
contentType
(string, "text/plain")The content type of the e-mail body.
Input
none (except over variable substitution)
Transitions
ok
if sending was successful
sendFailed
(optional)If an error happened during sending.
default
If an error happened.
Output
none
Errors
AUTH_FAILED
If sending of the email failed and no sendFailed transition is configured.
Notes
none
Example
<AuthState name="SendMail" class="ch.nevis.esauth.auth.states.mail.SendMail" final="false">
<ResultCond name="default" next="AuthError" />
<ResultCond name="ok" next="DoMoreStuff" />
<Response value="AUTH_ERROR">
<Gui name="AuthErrorDialog"/>
</Response>
<property name="mail.smtps.host" value="smtp.gmail.com" />
<property name="mail.smtps.port" value="543" />
<property name="smtpUser" value="[email protected]" />
<property name="smtpPass" value="secret" />
<property name="subject" value="Welcome ${request:userId}" />
<property name="body" value="${notes:template}" />
<property name="sender" value="[email protected]" />
<property name="receivers" value="${notes:email}" />
</AuthState>