Tuesday, November 19, 2013

SOA 11g - Email Configuration with multiple accounts - Single SMTP server

Below are steps to configure multiple email accounts (associated with different From email address), using single SMTP server.

For example below is hypothetical requirement:,
We have SMTP server running on localhost 25, and we would like to configure email account Default (chintan@springsoa.com) and HR (hr@springsoa.com).

  • Configure usermessagedriver-email  
 Configure as below. Please make sure Sender Address is blank, so we will be able use this UMS driver for any "from" email (e.g. chintan@springsoa.com, hr@springsoa.com, which want to use for this demo)

  • Configure Workflow Properties as below

  • Till above, we have configured Default email account. Now we will configure HR email account as below using ASNSDriver. Click on "More Workflow Notification Properties"

  • Click on Operation -> setASNSDriver

  • Configure ASNS Driver
Property Name : EmailFromAddress
Property Value : hr@springsoa.com
Driver Name     : HR

Click Invoke.

You can invoke this method multiple times to set different values. It will be upsert operation.

Property Name : EmailReplyToAddress
Property Value : hr@springsoa.com
Driver Name     : HR

Property Name : EmailRespondToAddress
Property Value : hr@springsoa.com
Driver Name     : HR

Property Name : IMRespondToAddress
Property Value : hr@springsoa.com
Driver Name     : HR


  • Verify ANS Driver
 Click on Attributes, and verify Default and HR both shows up under ASNSDrivers

  • Restart Admin and SOA servers

  • Now, inside BPEL Email activity, we can use HR to send email from hr@springsoa.com, and Default to send email from chintan@springsoa.com

2 comments:

Unknown said...

A good tutorial to know about smtp server & their settings.

Thanks
Email.biz

Unknown said...

If I send email from an account that does not exist (lets say in this case "Test Driver") it automatically sends from last added ASNSDriver (in this case "HR" account). Is this normal behaviour? In this situation I would like to send from Default account.