Skip to main content

Report mailer

Using the TSFReportMailer custom task, provided with the Software Factory, it is possible to export reports and/or send emails from the Software Factory.

It is produced by creating a GUI code task or report. The Object name must be entered with TSFReportMailer. Use can be made of the following table for creating parameters.

Parameters

An overview of the parameters that can be used:

ParameterDefault ValueData typeDescription
report_idstringName of the report
export_file_specstringExport file name (for example to be filled from a default)
export_file_extensionpdfstringWith this parameter, the file format can be selected of the report that will be generated. The parameter value is not case sensitive.
Possible values:
- rtf
- csv
- xml
- xls
- xls_data
- xlsx_data
- doc
- word_rtf
- pdf
overwrite_oldfalsebooleanOverwrites the file if it already exists and if this parameter is set to true.
send_mailtruebooleanTries to send an email if this parameter is set to true.
open_in_outlookfalsebooleanTries to open the email if this parameter is set to true.
save_mailfalsebooleanTries to save the email in the Drafts folder if this parameter is set to true.
NOTE: If open_in_outlook is also set to true then this parameter will be ignored!
htmlfalsebooleanThis parameter converts the format of the email to HTML if it is set to true.
priority1integerThis parameter indicates the urgency of the email.
Possible values:
0 = low urgency
1 = normal urgency
2 = high urgency.
e_mailstringEmail address to which the email has to be sent. (The TSFReportMailer can be sent to multiple email addresses, which have to be separated by a semicolon.)
ccstringCC email address for the email. (The TSFReportMailer can be sent to multiple email addresses, which have to be separated by a semicolon.)
bccstringBCC email address for the email. (The TSFReportMailer can be sent to multiple email addresses, which have to be separated by a semicolon.)
reply_tostringReply-to email address for the email. (Multiple email addresses can be added here, which have to be separated by a semicolon.)
bodystringIf HTML tags are used for the actual message of the email, then the html parameter has to be set to true.
subjectstringThe subject of the email.
use_signaturefalsebooleanIf this parameter is set to true, the standard signature is used that is configured in Outlook.
signature_textstringSet this parameter if you want to use a different signature text.
signature_imagestringSet the parameter if you want to use an image in the signature of the email.
accountstringSet this parameter if the email should be sent from a different account than the default account that is installed on the PC.
sent_on_behalf_of_namestringSet this parameter to send the report on behalf of a different email address.
delete_filefalsebooleanSet this parameter to true if the report, which is used as an attachment, should be deleted after sending the email.
smtp_onlyfalsebooleanSet this parameter to true if you just want to email with SMTP and do not want to email with Outlook.
smtp_usernamestringUser name of the SMTP.
smtp_passwordstringPassword of the SMTP.
smtp_hoststringHost address of the SMTP
smtp_port0integerThe port to which the SMTP server listens. If this is not set, port 465 will be used for SSL. Without SSL, port 25 will be used
smtp_from_mailstringEmail address where the email comes from.
smtp_use_sslfalsebooleanSet this parameter to true if the SMTP server expects an SSL connection.
extra_attachmentsstringThis can be used to add extra attachments to the email. If more than one file is to be added, they have to be separated by means of a semicolon.
For example: C:/file1.txt;C:/file2.txt
smtp_from_displaynamestringWith this parameter, the display of the sender's name in an email can be modified. This parameter is optional.

If no values are entered, these fields are considered to be empty text fields and will be treated as such in the GUI. Initially, all parameters are optional, however, some of them are linked to each other.

Reports

To generate a report in PDF format with the TSFReportMailer, the following parameters at least have to be entered.

Mandatory
  • report_id
  • export_file_spec
Optional
  • overwrite_old
  • export_file_extension (default pdf)

Email via Outlook

To send an email with Outlook via the TSFReportMailer, the following parameters at least have to be entered and the parameter send_mail should be set to true, which is the default value.

Settings
  • send_mail = true
Mandatory
  • e_mail
note

This is not mandatory if the parameter open_in_outlook is set to true, the default value of this is false.

Optional
  • smtp_only
  • send_mail
  • open_in_outlook
  • save_mail
  • html
  • priority
  • e_mail
  • cc
  • bcc
  • body
  • subject
  • use_signature
  • signature_text
  • signature_image
  • account
  • extra_attachments

Email via SMTP

The TSFReportMailer tries as much as possible to revert to SMTP as it would otherwise become too much for the server. If this requires an alternative configuration, the mandatory parameters at least should be entered, otherwise the SMTP parameters will be ignored.

Settings
  • send_mail = true
  • smtp_only = true
Required fields
  • smtp_username
  • smtp_password
  • smtp_host
  • smtp_from_mail
  • e_mail
Optional fields
  • smtp_port
  • smtp_from_displayname
  • smtp_use_ssl

It is also possible to specify (part of) the SMTP settings using parameters in the configuration file so that these are the same for all users.


Was this article helpful?