|
boolean | addAttachment (Var attachment, String sourceFilePath) |
| Add an attachment to the email. More...
|
|
Email | Email (String to, String from, String subject, String body, String cc, String bcc, Date sendingTime, boolean deleteAfterSending) |
| Create a new instance of the Email class. More...
|
|
String | getLastError () |
| Get the description of the last error that occurred. More...
|
|
boolean | send () |
| Send the email to recipients. More...
|
|
boolean | setBCC (String bcc) |
| Set blind carbon-copy recipients of the email. More...
|
|
boolean | setBody (String body) |
| Set the content of the email. More...
|
|
boolean | setCC (String cc) |
| Set carbon-copy recipients of the email. More...
|
|
boolean | setDeleteAfterSending (boolean deleteAfterSending) |
| Decide on whether the email is to be deleted after successful sending. More...
|
|
boolean | setFrom (String from) |
| Set the sender's email address. More...
|
|
boolean | setSendingTime (Date sendingTime) |
| Set sending time of the email. More...
|
|
boolean | setSubject (String subject) |
| Set the subject of the email. More...
|
|
boolean | setTo (String to) |
| Set the primary recipients of the email. More...
|
|
The Email class allows to create and send an email.
All the email settings for the principal (such as SMTP server and authentication) are used when sending an email.
- Since
- DOCUMENTS 4.0d
- Example:
var mail =
new Email(
"receiver@domain.de",
"sender@domain.de",
"Test",
"This is a test email.");
mail.addAttachment("log.txt", "C:\\tmp\\changelog.txt");
mail.setBCC("somebody1@domain.de,somebody2@domain.com");
mail.setDeleteAfterSending(true);
if (!mail.send())
util.out(mail.getLastError());
Email Email::Email |
( |
String |
to, |
|
|
String |
from, |
|
|
String |
subject, |
|
|
String |
body, |
|
|
String |
cc, |
|
|
String |
bcc, |
|
|
Date |
sendingTime, |
|
|
boolean |
deleteAfterSending |
|
) |
| |
Create a new instance of the Email class.
In case of multiple recipients for the parameters to
, cc
or bcc
, the individual email addresses are to be separated by a comma (,). It is not allowed to send an email without any primary recipients specified by the parameter to
. To send a HTML email the body must begin with the <HTML> tag. Emails in following cases are stored in the folder Administration > Sent eMails
in the DOCUMENTS Manager:
- They are to be sent in the future (specified by
sendingTime
);
- Sending them failed;
- The parameter
deleteAfterSending
is set to false
.
- Parameters
-
to | String value containing the email addresses of primary recipients. |
from | Optional string value containing the sender's email address. If no sender is specified, the default sender for the principal is used. |
subject | Optional string value containing the subject of the email. |
body | Optional string value containing the content of the email. |
cc | Optional string value containing the email addresses of carbon-copy recipients (appearing in the header of the email). |
bcc | Optional string value containing the email addresses of blind carbon-copy recipients (remaining invisible to other recipients). |
sendingTime | Optional Date object specifying when the email is to be sent. If sending time is not specified, the email will be sent immediately by calling send(). |
deleteAfterSending | Optional flag indicating whether the email is to be deleted after successful sending. The default value is true . |
- Since
- DOCUMENTS 4.0d