Skip to content

I cannot send email

Answer

Use version 1.5.6.0 or later, and set the parameters of Mail.json with reference to the following.


Overview

If you cannot send email because of one of the following issues, set the appropriate parameters of Mail.json, which are available in version 1.5.6.0 and later.

No. Issue Parameter to Set
1 An error occurs in the revocation check of the SSL certificate SmtpCheckCertificateRevocation
2 You want to force a specific TLS version SmtpSslProtocols
3 The SMTP connection times out (the default value is not suitable) SmtpTimeout
4 You want to specify the domain name for the HELO command SmtpLocalDomain
5 You want to prevent STARTTLS downgrades in an environment that requires TLS SmtpRequireTls
6 You want to specify the source IP address explicitly SmtpLocalEndPoint
7 You need to connect to the SMTP server via a proxy The SmtpProxy* parameters
8 Client certificate authentication is required SmtpClientCertificate

1. An error occurs in the revocation check of the SSL certificate

Set SmtpCheckCertificateRevocation in Mail.json to false to skip the certificate revocation check.
 

{
    "SmtpCheckCertificateRevocation": false
}

2. You want to force a specific TLS version

Specify the TLS versions to force in SmtpSslProtocols in Mail.json.

{
    "SmtpCheckCertificateRevocation": true,
    "SmtpSslProtocols": "Tls12, Tls13",
    "SmtpTimeout": 120000
}

3. The SMTP connection times out (the default value is not suitable)

Specify a timeout (unit: ms) that suits your network environment in SmtpTimeout in Mail.json.

{
    "SmtpTimeout": 300000
}

4. You want to specify the domain name for the HELO command

Specify the local domain name to use as the SMTP client in SmtpLocalDomain in Mail.json.

{
    "SmtpLocalDomain": "mail.example.com"
}

5. You want to prevent STARTTLS downgrades in an environment that requires TLS

Set SmtpRequireTls in Mail.json to true to enable the REQUIRETLS extension.

{
    "SmtpRequireTls": true
}

6. You want to specify the source IP address explicitly

Specify the local endpoint to use as the connection source in SmtpLocalEndPoint in Mail.json, in the format "IP address:port number".

{
    "SmtpLocalEndPoint": "192.168.1.10:0"
}

7. You need to connect to the SMTP server via a proxy

Set the following parameters to send email via an HTTPS proxy. The following example specifies SmtpProxyUserName and SmtpProxyPassword explicitly, but for security reasons we recommend setting them in environment variables. For details, refer to Mail.json.

{
    "SmtpProxyType": "Https",
    "SmtpProxyHost": "proxy.example.com",
    "SmtpProxyPort": 443,
    "SmtpProxyUserName": "proxy-user",
    "SmtpProxyPassword": "secret",
    "SmtpProxyCheckCertificateRevocation": true,
    "SmtpProxySslProtocols": "Tls12, Tls13"
}

8. Client certificate authentication is required

Specify the parameters that identify the client certificate in SmtpClientCertificate in Mail.json.
 

{
    "SmtpClientCertificate": {
        "StoreName": "My",
        "StoreLocation": "CurrentUser",
        "X509FindType": "FindByThumbprint",
        "FindValue": "ABCD1234..."
    }
}