ÃÛ¶¹ÊÓƵ

Configure outgoing emails

You can enable and disable outgoing emails for integration (and staging for Starter only) environments from the Cloud Console or from the command line. Enable outgoing emails to send two-factor authentication or reset password emails for Cloud project users.

By default, outgoing emails are enabled in Production and Staging (Pro only) environments. However, the Enable outgoing emails setting may appear disabled in the environment settings regardless of status until you set the enable_smtp property through the command line or Cloud Console.

Updating the enable_smtp property value by command line also changes the Enable outgoing emails setting value for this environment on the Cloud Console.

NOTE
Enabling/disabling the Enable outgoing emails setting will not enable/disable emails in the Pro Staging or Production environments.
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, ÃÛ¶¹ÊÓƵ recommends completing this work during off-peak hours to avoid service disruptions.

Enable emails in the Cloud Console

Use the Outgoing emails toggle in the Configure environment view to enable or disable email support.

If outgoing emails must be disabled or re-enabled on Pro Production or Staging environments, you can submit an ÃÛ¶¹ÊÓƵ Commerce Support ticket.

TIP
Outgoing email status may not be reflected for Pro Staging or Production environments in the Cloud Console.

To manage email support from the Cloud Console:

  1. Log in to the .

  2. Select a project from the All projects list.

  3. On the Project dashboard, click the configuration icon in the upper right.

  4. Click Environments and select a specific environment from the list (except Staging and Production for Pro).

  5. To enable or disable outgoing emails, toggle Enable outgoing emails On or Off.

    Enable outgoing email configuration

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

Enable emails in the CLI

You can change the email configuration for an active environment 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.

To manage email support from the command line:

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

  2. Check the outgoing email setting for the environment.

    code language-bash
    magento-cloud environment:info -e <environment-id> | grep enable_smtp
    
  3. Change the email support configuration by setting the enable_smtp environment variable to true or false.

    code language-bash
    magento-cloud environment:info --refresh -e <environment-id> enable_smtp true
    

    Wait for the environment to build and deploy.

  4. Use an SSH to log into the remote environment.

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

    code language-bash
    php -r 'mail("mail@example.com", "test message", "just testing", "From: tester@example.com");'
    
  6. Verify that the email is picked up by SendGrid.

    code language-bash
    grep mail@example.com /var/log/mail.log
    
recommendation-more-help
05f2f56e-ac5d-4931-8cdb-764e60e16f26