Overview
Version
| Report Server Version | Functional Change |
|---|---|
11.0 | / |
11.0.2 | Allowed you to add multiple senders and set a default sender. |
Function Description
FineReport allows you to receive and send emails. Either way, you need to configure the mailbox information.
1. You can add multiple senders and set a default sender.
2. You can view historical email sending records and filter them by the sender, recipient, template name, and so on.
Sender Account Setting
You can set a sender account with two steps.
1. Add a sender.
2. Select a default system sender from the added senders.
Note: If the system default sender is not configured, the email service is considered unconfigured.
Adding a Sender
Log in to the decision-making platform as the admin, choose System Management > System Setting > Mailbox, click Add a Sender, configure sender account information, and click OK, as shown in the following figure.

The following table describes the setting items of the sender account.
| Email Setting Item | Description |
|---|---|
Mail Server (SMTP) | Select the mail server. You can select a mail server corresponding to your mailbox from the drop-down list. You can manually enter the mail server formatted as SMTP.email suffix. Note: |
Port and Encryption Method | Set the port and encryption method for the email service. By default, port 25 and TLS encryption are used. Generally, no modification is needed. However, if the server port does not support the default port 25, or the SMTP server does not support SSL encryption, you must modify the port number and the encryption method. Three encryption methods are available: SSL Encryption, TLS Encryption, and No Encryption. Note: 1. You are advised to use TLS encryption for higher security. 2. To use encryption, ensure that the encryption certificate has been added to the trusted certificate list in Java; otherwise, the Java program running FineReport cannot read the encrypted response. |
Sender Address | Enter the sender's email address. You can only add one sender account at a time. The Sender email address can include hashtags (#) and ampersands (&). |
Password | For most email accounts, enter the email password. For QQ and 163 email accounts, you need to enter an authorization code, rather than the account password. For details, see the "POP3/SMTP Service Enablement and Authorization Code Generation" section. |
Displayed Name | Enter the displayed name (customizable) of the sender. The displayed name is required. If you leave it blank, the email service configuration cannot be recognized when an email sending event is triggered in the designer. |
Send Test Mail | Test whether the mail server is configured correctly. |
After configuring Sender Account Setting, click Send Test Email, enter a recipient email address, and click OK.
If the recipient receives a test email with the content "Congratulations! Your mail server is configured successfully.", the mail server has been configured correctly.
Click OK to add the sender, as shown in the following figure.
Note: 1. The email body is displayed in HTML format. Fonts that are not supported will be displayed as the SimSun font.
2. The unsupported fonts are those that contain special symbols, such as spaces and hyphens (-), in the font names. For example, Wingding 3 is not supported.

FineReport allows you to configure multiple senders and edit/delete senders, as shown in the following figure.

Setting the Default Sender
After adding the sender, select one of the added senders in System Default Sender as the admin, and click Save for the setting to take effect, as shown in the following figure.
Note: If the sender address corresponding to System Default Sender is deleted, System Default Sender becomes empty, and the email service configuration is not complete.
POP3/SMTP Service Enablement and Authorization Code Generation
After enabling the POP3/SMTP service, you can send and receive emails in the client. If the POP3/SMTP service is not enabled, email service configuration may fail.
When you configure a QQ or 163 mailbox as the sender account, an authorization code is required for verification.
Note: QQ Mail
Log in to QQ Mail, choose Settings > Account and Security, and enable POP3/IMAP/SMTP/Exchange/CardDAV Service, as shown in the following figure.


Follow the prompt to send an SMS for security verification.
After the message is sent, the service is enabled successfully, and an authorization code is generated. You need to enter the authorization code, rather than the actual password of your QQ email account, in Password in the Sender Account Setting window, as shown in the following figure.

163 NetEase Mail
Log in to 163 Mail, choose Settings > General Settings > POP3/SMTP/IMAP, and enable POP3/SMTP service, as shown in the following figure.
Note: 
After you click Enable, the Account Security Reminder window will appear. Enter the SMS code you have received, and click Verify to complete verification, as shown in the following figure.

After the verification is completed, a prompt will appear, saying "POP3/SMTP service opened successfully", and an authorization code is generated. You need to enter the authorization code, rather than the actual password of your 163 email account, in Password in the Sender Account Setting window, as shown in the following figure.
Note: 
Tencent Exmail
1. Enabling POP/SMTP service
Log in to Tencent Exmail, choose Set > Client Settings > Enable Service, tick Enable POP/SMTP Service, and click Save Changes, as shown in the following figure.

2. Obtaining the port number and encryption method
Choose Set > Client Settings > How to set, and find the port number and encryption method in Outgoing mail server.
When configuring a sender account in the decision-making platform, you need to ensure that the port and encryption method are matched with those of the outgoing mail server. In this example, the port number is 465 and the encryption method is SSL, as shown in the figure.

3. Getting the client-specific code
Click WeChatLink, and bind your email account to a WeChat account, as shown in the following figure.

After successful binding, click Enable secure login, as shown in the following figure.
After enabling secure login, you need to log in to the mailbox again, and the original password cannot be used. For the web version, you can scan the QR code with WeChat to log in. For the client, you can use the client-specific code to log in.

To obtain the client-specific code, you can click Generate New Password.
When configuring the sender account on the decision-making platform, enter the client-specific code, rather than the mailbox password, as shown in the following figure.

MS Exchange Email
Before adding a sender account, you need to collect the following information:
Mail Server (SMTP): IP address of the mail server
Sender Address: Exchange email address
Password: Login password for Exchange email account
Log in to the decision-making platform as the admin, choose System Management > System Setting > Mailbox, click Add Sender, and configure the sender account. Enter the collected information and select No Encryption as the encryption method.

After configuring the sender account, click Send Test Email, enter a recipient email, and click OK.
If the recipient receives a test email with the content "Congratulations! Your mail server is configured successfully.", the mail server has been configured correctly.
Click OK to add the sender, as shown in the following figure.

Mail Sending Record
You can query the system's historical email sending records by Sender, Receiver Email, Template Name, and Date Interval.
The sending record displays information including Sender, IP Address, Receive Email, Template Name, Accessed Resources, Sending Time, and Sending Result, as shown in the following figure

Notes
Network Configuration
To use the email service, you need to ensure connectivity between the report project and the email server.
1. For email service from external mail servers, such as QQ and 163 mailboxes, ensure that the report project can access the external network.
2. When using your own internal mail server, you need not connect to the external network. Just ensure that the report project can connect to the mail server.
Test Email Sending Failure Caused by Untrusted Certificate by Java
Problem:
On the internal network server, sending SSL-encrypted emails using Foxmail works fine, but the sending fails when you switch to FineReport. Emails can be sent when you change to port 25 with no encryption.
An error message is displayed: "Could not connect to SMTP host: SMTP.fanruan.cn, port: 465, response: -1."

Cause:
You did not add the certificate of the mail server that you set up on the internal network to the trusted certificate list in Java. Emails cannot be sent using certificates that are not included in the list. For clients that have their own trusted certificate system, for example, Firefox, the emails can be sent normally.
Solution:
You can import the certificate into the trusted certificate list in Java.
Anti-Spam Mechanism
Problem: An error is reported in the log: "com.sun.mail.smtp.SMTPSendFailedException: 554."
Cause: This error occurs because, with the anti-spam mechanism of the 163 mail server, the test email with the subject "test" is flagged as spam and fails to be sent.
Solution: You can avoid using words like "test" in the subject of test emails. If the email is then sent successfully, the configuration is correct, and the issue is caused by restrictions of the server itself.
Error in Getting the Verification Code
If emails are sent frequently within one minute, the error message is displayed: "Failed to obtain verification code.", as shown in the following figure.
You can wait for one minute and then try again.

Error in Using Port 465
Problem:
An error message is displayed: "Could not connect to SMTP host: SMTP.exmail.qq.com, port: 465, response: -1'."
Cause:
Port 465 is open for the SMTPS (SMTP over SSL) protocol, which secures SMTP by wrapping SMTP inside TLS.
However, the email service of FineReport requires the SSL protocol.
Solution:
You can switch to port 25.