SendEmail

Last updated: 2020-10-19 10:42:14

    1. API Description

    Domain name for API request: dms.tencentcloudapi.com.

    This API is used to send regular emails.

    A maximum of 20 requests can be initiated per second for this API.

    We recommend you to use API Explorer
    Try it
    API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

    2. Input Parameters

    The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

    Parameter Name Required Type Description
    Action Yes String Common parameter. The value used for this API: SendEmail.
    Version Yes String Common parameter. The value used for this API: 2020-08-19.
    Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
    FromAddress Yes String Sender
    ToAddress Yes String Recipient
    Subject Yes String Email summary
    FromName No String Sender name
    ReplyAddress No String Reply-to address
    HtmlContent No String The body of an HTML email
    TextContent No String The body of a plain-text email

    3. Output Parameters

    Parameter Name Type Description
    Result Boolean The result of creating an email task
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Sending regular emails

    Input Example

    https://dms.tencentcloudapi.com/?Action=SendEmail
    &FromAddress=test@example.com
    &ToAddress=to@example.com
    &ReplyAdress=reply@example.com
    &Subject=subject
    &<Common request parameters>

    Output Example

    {
      "result": true
    }

    5. Developer Resources

    API Explorer

    This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InternalError.InternalCOSError COS exception.
    InternalError.InternalDBError Database service exception.
    InternalError.InternalEncryptError Encryption service exception.
    InvalidParameter.InvalidFromNameMalformed Format of the sender name is incorrect.
    InvalidParameter.InvalidHtmlContentMalformed Format of the HTML email body is incorrect.
    InvalidParameter.InvalidMailAddressNameMalformed Format of the email address is incorrect.
    InvalidParameter.InvalidMailContentMalformed Format of the email body is incorrect.
    InvalidParameter.InvalidReceiverNameMalformed Format of the recipient address is incorrect.
    InvalidParameter.InvalidSubjectMalformed Format of the summary is incorrect.
    InvalidParameter.InvalidTaskNameMalformed Format of the email task name is incorrect.
    InvalidParameter.InvalidTextContentMalformed Format of the plain-text email body is incorrect.
    ResourceInUse.InvalidTaskNameDuplicate The email task name already exists.
    ResourceNotFound.InvalidMailAddressNotFound The email address does not exist.
    ResourceNotFound.InvalidReceiverNotFound The recipient address does not exist.
    ResourceNotFound.InvalidReplyNotFound The reply-to address does not exist.
    ResourceNotFound.InvalidTaskNameNotFound The email task does not exist.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help