Replacing SMTP old server "from" mail address to new address
search cancel

Replacing SMTP old server "from" mail address to new address

book

Article ID: 193079

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine CA Automic One Automation

Issue/Introduction

Is there a way to replace the existing "from" email address with a new email id when sending an email from Automic?

Environment

Release : 12.1, 12.2, 12.3, 21.0

Component : AUTOMATION ENGINE

Resolution

The "from" email address is determined using the SMTP_FROM_ADDR in UC_CLIENT_SETTINGS.  

There are two ways to do this:

  • Manually:
    1. In the client where the notification is being sent from, open UC_CLIENT_SETTINGS
    2. Where the key SMTP_FROM_ADDR is used, update value1 to the new email address (if SMTP_FROM_ADDR is not present, it can be added)
    3. Save the changes to UC_CLIENTSETTINGS
  • Example of doing this automatically:

It's possible to do this through scripting, but it's not 100% reliable since if multiple objects update the UC_CLIENT_SETTINGS variable at the same time, there may be a conflict where it sends from an email address that is unintended.  Here is an example where the email address is originally [email protected], but it's changed to [email protected] and then back.  The :wait 5 is to ensure that system has picked up the change before the email sends out.  

!set smtp from address variable
:set &smtp_from# = '[email protected]'
!update uc_client_settings to update smtp_from_addr to the variable set above
:put_var_col 'uc_client_settings', 'smtp_from_addr', 1, &smtp_from#
!wait 5 seconds so that the send_mail picks up the change fully
:wait 5
!send mail
:set &ret# = send_mail('[email protected]', , 'Subject line is here', 'Email Body text is here')
!wait 5 seconds so that the email goes through with the new smtp from
:wait 5
!update smtp from address variable 
:set &smtp_from# = '[email protected]'
!update uc_client_settings to update smtp_from_addr to the variable set above
:put_var_col 'uc_client_settings', 'smtp_from_addr', 1, &smtp_from#

In order to have this setup out of the box and more reliably used, an enhancement request would need to be made.  This can be done here: https://community.broadcom.com/ideation/allideas - once there, use the "ADD" button to start putting in a request and then choose "Automic Workload Automation" from the Category dropdown.

 

No restart is required after either of these methods

For more information, see UC_CLIENT_SETTINGS - SMTP Parameters

Additional Information

Information on the SEND_MAIL function can be found here: https://docs.automic.com/documentation/WEBHELP/English/all/components/DOCU/21.0.5/Automic%20Automation%20Guides/Content/Script/Reference/SEND_MAIL.htm?tocpath=Reference%7CAutomation%20Engine%20Script%20Reference%7CScript%20Elements%20Ordered%20by%20Purpose%7CUsers%7C_____10

Please pay extra attention to any notes that show as "Important!"