Set Parameter: Mail.json
## Supported Versions
### ServerCertificateValidationCallback
Pleasanter 1.3.18.0 or later
### SecureSocketOptions
Pleasanter 1.3.49.0 or later
## Notes
When changing parameters, please refer to "[Confirmation When Changing Parameters](/en/manual/parameter-edit)".
## Setting Values
The setting values for this Parameter file are as follows.
# Description of Each Parameter
## When Using an SMTP Server
|Parameter name|Value (e.g)|Description|
|:--|:--|:--|
|SmtpHost|"smtp.example.com"|Specify the address of the SMTP server. |
|SmtpPort|25|Specify the port of the SMTP server. |
|SmtpUserName|"UserName"|Specify the user name for SMTP-AUTH. Specify null if user authentication is not performed. |
|SmtpPassword|"Password"|Specify the password for SMTP-AUTH. Specify null if user authentication is not performed. |
## When Using SendGrid
|Parameter name|Value (e.g)|Description|
|:--|:--|:--|
|SmtpHost|"smtp.sendgrid.net"|Specify the address of SendGrid. |
|SmtpPort|0|No setting required if using SendGrid. |
|SmtpUserName|"apikey"| Specify "apikey" (fixed value). |
|SmtpPassword|"SG.xxxxxxx"|Specify the API key of SendGrid. |
Example description of the above columns:
```
"SmtpHost": "smtp.sendgrid.net",
"SmtpPort": 0,
"SmtpUserName": "apikey",
"SmtpPassword": "SG.xxxxAPIKeyxxxxxx...",
```
## Common Settings
|Parameter name|Value (e.g)|Description|
|:--|:--|:--|
|SmtpEnableSsl|false|Specify true to enable SSL. If set to true, the StartTls encryption method will be applied. If you want to specify a different method, use the SecureSocketOptions Parameter. |
|ServerCertificateValidationCallback|false|Specify true to suppress the error "An error occurred while attempting to establish an SSL or TLS connection". |
|SecureSocketOptions|"SslOnConnect"|Specify the SSL/TLS encryption method to use for the connection. The default value is null. For allowed strings, refer to [Enum Names](http://www.mimekit.net/docs/html/T_MailKit_Security_SecureSocketOptions.htm) available in MimeKit. |
|FixedFrom|"fixed@example.com"|If an email address is specified, this will be the from address when sending an email. If null is set, the logged-in user's email address will be the from address. |
|AllowedFrom|["support@example.com"]|If FixedFrom is not null and corresponds to an email address listed in AllowedFrom, FixedFrom will not be used and the email address of the logged-in user will be the from. |
|SupportFrom|"support@example.com"|Specify a support email address. Required when using "[Enable 2-step Authentication by Email](/en/manual/secondary-authentication)". |
|InternalDomains|".example1.com,.example2.com"|If you want to restrict the domains to which emails can be sent, specify a whitelist separated by commas. |
|AddressValidation|"\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]+\\b"|Specify the regular expression used to validate email addresses. |
|Encoding|"shift_jis"|The default value is null. Specify explicitly if you want to change it to something other than UTF-8. If the system does not support the encoding name, an error will be output to SysLogs when the settings are loaded, and then sending will be attempted in UTF-8. |
|ContentEncoding|"SevenBit"| The default value is null. For permitted strings, refer to [Enum Names](http://www.mimekit.net/docs/html/T_MimeKit_ContentEncoding.htm) available in MimeKit. |
To ensure this parameter file is not mistakenly made public externally, a function to obtain user authentication information from the OS system environment variables has been added (ver.1.2.21.0).
System environment variable naming convention:
|No|Variable name|
|:--|:--|
|1|(Service name)_Mail_SmtpUserName|
|2|(Service name)_Mail_SmtpPassword|
It is still possible to set these in this parameter file as before.
For Azure, add/edit from [App Service Settings] -> [Configuration] -> [Application Settings].
When set in both this parameter file and the system environment, the priority is as follows:
### SmtpUserName Priority
|Priority order|Setting value|
|:--|:--|
|1|"SmtpUserName" in this parameter file|
|2|"(Service name)_Mail_SmtpUserName" in the environment variable|
### SmtpPassword Priority
|Priority order|Setting value|
|:--|:--|
|1|"SmtpPassword" in this parameter file|
|2|"(Service name)_Mail_SmtpPassword" in the environment variable|