Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Can i configure two Email Service providers in one AEM instance.?

Avatar

Level 5

Is there any possibility to configure two Email Service providers in one AEM instance.? Am planning to use a AEM as multi tenant, where the each website is having their own email servers.

Thanks,

KK

1 Accepted Solution

Avatar

Correct answer by
Level 10

where the each website is having their own email servers

WHen configuring email on AEM out of the box - you have this configuration screen: 

As you can see - there is only fields for: 

  • SMTP server host name - the SMTP server that you want to use.
  • SMTP server port - the server port to use, Typically this value is 25. 
  • Username - the user name for the SMTP user. 
  • Password - the corresponding password.

 

Therefore - there is no option for a 2nd configuration. All AEM sites that use email and MessageServicGateway will use this 1 configuration. 

 

Now if you really want to have each site on 1 instance use its own mail server - you can code a custom email service that uses the Java MAIL API. Then you can code the configurations in Java. That way - 1 site can invoke customEmailService1 and site2 can invoke customEmailService2. 

 

For example - in Java: 

 Properties properties = System.getProperties();
 
        // Setup mail server (Depending upon your
        // Mail server - you may need more props here
        properties.setProperty("mail.smtp.host", aHost);
        properties.setProperty("mail.smtp.user", "<valid SMTP user>");

This 1-1 way does not use ootb AEM email cofiguration

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

where the each website is having their own email servers

WHen configuring email on AEM out of the box - you have this configuration screen: 

As you can see - there is only fields for: 

  • SMTP server host name - the SMTP server that you want to use.
  • SMTP server port - the server port to use, Typically this value is 25. 
  • Username - the user name for the SMTP user. 
  • Password - the corresponding password.

 

Therefore - there is no option for a 2nd configuration. All AEM sites that use email and MessageServicGateway will use this 1 configuration. 

 

Now if you really want to have each site on 1 instance use its own mail server - you can code a custom email service that uses the Java MAIL API. Then you can code the configurations in Java. That way - 1 site can invoke customEmailService1 and site2 can invoke customEmailService2. 

 

For example - in Java: 

 Properties properties = System.getProperties();
 
        // Setup mail server (Depending upon your
        // Mail server - you may need more props here
        properties.setProperty("mail.smtp.host", aHost);
        properties.setProperty("mail.smtp.user", "<valid SMTP user>");

This 1-1 way does not use ootb AEM email cofiguration

Avatar

Level 7

I think this should answer your query.

Thanks

Tuhin