Configure Email - Bloomreach Experience - The Headless Digital Experience Platform Built for Commerce

Configure Email



BRC provides an SMTP server based on AWS SES. This page explains how to configure the SMTP server for your Bloomreach Cloud stack to enable your Bloomreach Experience Manager implementation to send email messages.


To enable the applications deployed in your Bloomreach Cloud stack to send email messages, you need credentials and the host configuration string for the SMTP server. BloomReach can provide these on request. To do so, BloomReach will ask you on behalf of AWS to put some entries into your DNS to prove you own the domain. It is best not to wait too long with entering these entries. After the confirmation, BloomReach will upload a mail configuration file to your stack. This configuration file will contain the following properties:

When deploying a distribution, you need to include this configuration file for use as Java system properties. From now on your code can use the configuration from the file as shown below in the code example.

Note that you can only send emails from the verified domain. This means that the fields "From", "Source", "Sender", or "Return-Path" addresses must use the verified domain.


A mail/Session container variable is automatically configured in your environment using the system properties mentioned above. This can be used directly with, for example, Enterprise Forms.

Alternatively, your custom code can use the system properties directly as in the example below. This example is based on the AWS Java SMTP example. Notice the brc.mail.* entries, these are populated through system properties from the configuration file.

// returns info message or exception message
private String brcMail() throws MessagingException, UnsupportedEncodingException {
    // Replace [email protected] with your "From" address.
    // This address must be verified.
    final String FROM = "[email protected]";
    final String FROMNAME = "Customer";

    // Replace [email protected] with a "To" address. 
    final String TO = "[email protected]";

    // The port you will connect to on the Amazon SES SMTP endpoint.
    final int PORT = 587;

    final String SUBJECT = "BRC Test";

    final String BODY = String.join(
            "<h1>BloomReach Cloud Email Test</h1>",
            "<p>This email was sent with BloomReach Cloud using the ",
            "<a href=''>Javamail Package</a>",
            " for <a href=''>Java</a>."

    // Create a Properties object to contain connection configuration information.
    Properties props = System.getProperties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.port", PORT);
    props.put("mail.smtp.starttls.enable", "true");
    props.put("mail.smtp.auth", "true");

    // Create a Session object to represent a mail session with the specified properties.
    Session session = Session.getDefaultInstance(props);

    // Create a message with the specified information.
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(FROM, FROMNAME));
    msg.setRecipient(Message.RecipientType.TO, new InternetAddress(TO));

    // Create a transport.
    Transport transport = session.getTransport();

    // Send the message
    String result;

        // Connect to Amazon SES using the appConfigFile

        // Send the email.
        transport.sendMessage(msg, msg.getAllRecipients());
        result = "Email sent!";
    catch (Exception ex) {
        System.out.println("The email was not sent.");
        System.out.println("Error message: " + ex.getMessage());
        result = ex.getMessage();
        // Close and terminate the connection.
    return result;

Enterprise Forms

If you plan to use Enterprise forms, you also need to deploy the mail configuration file together with your distribution. It is critical to configure enterprise forms to use a sender email address that has been verified.
Note that using Enterprise forms will have an impact on the Blue/Green deployments; during the content freeze, data that is stored in the 'old' repository will get lost if you do not migrate the data to the new repository.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?