Home > Contents > Index >
Expanded TOC   |    Accordion TOC   |    Annotated TOC   |    Index

 

Utilities.sendMail

Sends an SMTP message to one or more recipients.

The SendMail method has a number of variants. The differences are as follows:

To send mail, the Sites properties file must contain valid values for the cs.emailhost and cs.emailreturnto properties.


Utilities.sendMail

Sends an STMP mail message, letting you designate a MIME type and a character set.

Syntax

Parameters

from
Specify the e-mail address of the sender.

to
Specify the e-mail address of the recipient(s). If there are multiple recipients, use a comma to separate each e-mail address.

subject
Specify the one-line summary (the subject) of the e-mail message.

replyto
Specify the e-mail address to which the recipient should reply.

body
Specify the e-mail message itself.

server
Specify the name of the mail server that will send the message to the recipient.

contenttype
Specify the MIME type of the body; for example, text/plain or
text/html. Default is text/html.

charset
The character set for the subject. Popular values include:

err
If there is a problem sending the message, sendMail returns errors here.

Returns

Returns true on success, false on failure. If false is returned, examine err to determine the reason.

Example

The following code sends a short e-mail message to two recipients:


Utilities.sendMail

Sends an STMP mail message, letting you designate a content type. Default character set is UTF-8.

Syntax

Parameters

from
Specify the e-mail address of the sender.

to
Specify the e-mail address of the recipient(s). If there are multiple recipients, use a comma to separate each e-mail address.

subject
Specify the one-line summary (the subject) of the e-mail message.

replyto
Specify the e-mail address to which the recipient should reply.

messagestr
Specify the e-mail message itself.

server
Specify the name of the mail server that will relay the message to the recipient.

contenttype
Specify the MIME type of the message body; for example, text/plain or
text/html. Default is text/html.

err
If there is a problem sending the message, sendMail returns errors here.

Returns

Returns true on success, false on failure. If false is returned, examine err to determine the reason.


Utilities.sendMail

Sends an STMP mail message. The content type defaults to text/html. Default character set is UTF-8.

Syntax

Parameters

from
Specify the e-mail address of the sender.

to
Specify the e-mail address of the recipient(s). If there are multiple recipients, use a comma to separate each e-mail address.

subject
Specify the one-line summary (the subject) of the e-mail message.

replyto
Specify the e-mail address to which the recipient should reply.

messagestr
Specify the e-mail message itself.

server
Specify the name of the mail server that will relay the message to the recipient.

err
If there is a problem sending the message, sendMail returns errors here.

Returns

Returns true on success, false on failure. If false is returned, examine err to determine the reason.


Utilities.sendMail

Sends an STMP mail message, letting you designate a MIME type and a character set. Specify an array of recipients.

Syntax

Parameters

from
Specify the e-mail address of the sender.

to
Specify the e-mail address of the recipient(s), each in a different cell of an array of strings.

subject
Specify the one-line summary (the subject) of the e-mail message.

replyto
Specify the e-mail address to which the recipient should reply.

body
Specify the e-mail message itself.

server
Specify the name of the mail server that will send the message to the recipient.

contenttype
Specify the MIME type of the body; for example, text/plain or
text/html. Default is text/html.

charset
The character set for the subject. Popular values include:

err
If there is a problem sending the message, sendMail returns errors here.

Returns

Returns true on success, false on failure. If false is returned, examine err to determine the reason.

Example

The following code sends a short e-mail message to two recipients:


Utilities.sendMail

Sends an STMP mail message, letting you designate a content type. Default character set is UTF-8. Specify an array of recipients.

Syntax

Parameters

from
Specify the e-mail address of the sender.

to
Specify the e-mail address of the recipient(s), each in a different cell of an array of strings.

subject
Specify the one-line summary (the subject) of the e-mail message.

replyto
Specify the e-mail address to which the recipient should reply.

messagestr
Specify the e-mail message itself.

server
Specify the name of the mail server that will relay the message to the recipient.

contenttype
Specify the MIME type of the message body; for example, text/plain or
text/html. Default is text/html.

err
If there is a problem sending the message, sendMail returns errors here.

Returns

Returns true on success, false on failure. If false is returned, examine err to determine the reason.


Utilities.sendMail

Sends an STMP mail message. The content type defaults to text/html. Default character set is UTF-8. Specify an array of recipients.

Syntax

Parameters

from
Specify the e-mail address of the sender.

to
Specify the e-mail address of the recipient(s), each in a different cell of an array of strings.

subject
Specify the one-line summary (the subject) of the e-mail message.

replyto
Specify the e-mail address to which the recipient should reply.

messagestr
Specify the e-mail message itself.

server
Specify the name of the mail server that will relay the message to the recipient.

err
If there is a problem sending the message, sendMail returns errors here.

Returns

Returns true on success, false on failure. If false is returned, examine err to determine the reason.

 

  Home > Contents > Index >

Oracle JAVA Reference
Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.