Help Center/ Huawei Cloud Astro Zero/ FAQs/ Application Backend Development/ How Do Huawei Cloud Astro Zero Developers Use Their Own Email Addresses to Send Emails?
Updated on 2025-08-14 GMT+08:00

How Do Huawei Cloud Astro Zero Developers Use Their Own Email Addresses to Send Emails?

Description

When sending an email using the Send Email diagram element in a flow or the sendEmail method in a script, the default sender is the email address configured on the platform. You can perform the following operations to use your own email address to send emails.

Solution

Try either of the following:

  • Use the sendCustomEmail method provided in the script.

    Method: sendCustomEmail(userName: string, password: string, sender: string,template: string, input: Map, smtpHost string)

    • userName and password: username and password for logging in to the mailbox
    • sender: email address of the sender
    • template: (optional) name of the email template used to send emails
    • smtpHost: (optional) email server. The sender email address must match the email server.
    • input: email recipient (Address: a string. Separate multiple address by semicolons), email subject (Subject: a string), and email content (Body: a string)

      After the email-sending script is defined, you can call it in a flow to send emails using the tenant's own email address. The Send Email diagram element is no longer needed.

  • Configure a connector to connect to the SMTP, and call the connector in a flow or script to send emails. For details, see Interconnecting with SMTP to Send Emails.