Configure outgoing emails

By default, email support is disabled on Staging and Production environments. You must enable email support on an environment to send emails including Welcome, password reset, and two-factor authentication emails for Cloud project users.

You can manage email support for each Cloud project environment from the Project Web Interface or from the command line.

  • On master and integration branches, use the Outgoing emails toggle in the Configure environment view to enable or disable email support.

  • On Production and Staging environments, or other environments where the Outgoing emails toggle is not available in the Project Web Interface, change the configuration using the magento-cloud CLI environment:info command to set the enable_smtp property.

    Enabling SMTP updates the MAGENTO_CLOUD_SMTP_HOST environment variable with the IP address of the SMTP host for sending mail.

WARNING

The deployment process begins when you perform a merge, push, or synchronization of your environment, or when you trigger a manual redeployment, during which the Commerce application is in maintenance mode. For a Production environment, Adobe recommends completing this work during off-peak hours to avoid service disruptions.

To manage email support from the Project Web Interface:

  1. Log in to the Project Web Interface

  2. Click on the project.

  3. In the left environment list, click the name of the branch.

  4. To enable or disable outgoing emails, toggle Outgoing emails On or Off.

    Enable outgoing email configuration

After you change the setting, the environment builds and deploys with the new configuration.

To manage email support from the command line:

  1. Check the current email configuration in the Project Web Interface.

  2. If needed, change the email configuration.

  3. On your local workstation, change to your project directory.

  4. Change the email support configuration by setting the enable_smtp environment variable to true or false.

    magento-cloud environment:info --refresh -p <project-id> -e <environment-id> enable_smtp true
    

    Wait for the environment to build and deploy.

  5. Verify that the email works; send a test email to an address that you can check.

    php -r 'mail("mail@example.com", "test message", "just testing", "From: tester@example.com");'
    

On this page