mail (element)

Description

The mail element is used to send a generated report as an attachment in an e-mail message. It defines attributes used to control the creation and sending of the e-mail. The mail element can be included in the following elements:

Attributes

The following is a list of the attributes supported for the mail element.

Attribute Description Required
smtpHost

The name of the SMTP host used to send the mail. If the attribute is not specified, the value of the property named codepro.mail.smtpHost will be used. If the property is not defined, the value localhost will be used.

Either the attribute or the corresponding property must be defined.

smtpPort

The number of the port on which the host is listening. If the attribute is not specified, the value of the property named codepro.mail.smtpPort will be used. If the property is not defined, the value 25 will be used.

Either the attribute or the corresponding property must be defined.

username

The username used to access the mail server. If the attribute is not specified, the value of the property named codepro.mail.username will be used. It is an error if neither the attribute nor the property are specified.

Either the attribute or the corresponding property must be defined.

password

The password used to access the mail server. If the attribute is not specified, the value of the property named codepro.mail.password will be used. It is an error if neither the attribute nor the property are specified.

Either the attribute or the corresponding property must be defined.

from

The address used as the From field of the e-mail. If the attribute is not specified, the value of the property named codepro.mail.from will be used. It is an error if neither the attribute nor the property are specified.

Either the attribute or the corresponding property must be defined.

tolist

A comma-separated list of the e-mail addresses to which the message will be sent.

Yes
subject

The subject line of the message.

No, default is Audit report
message

The body of the message. If no message is specified the message body will consist of text indicating that the attached file was auto generated and sent from an Ant script together with a summary of the number of violations of each severity included in the report.

No

Examples

The following element, when nested within either an audit report, audit series report or metrics report element, will cause the report to sent as an attachment in an e-mail to the address projectManager@company.com.

<mail
      username="user"
      password="password"
      from="testManager@company.com"
      tolist="projectManager@company.com">