SAS® 9.4 SMTP configuration locations


There are multiple locations that SAS 9.4 uses to load email settings in order to send an email. This SAS KB article provides an overview of those locations in order to update the email settings. Note that you must verify all of the locations when making changes to SMTP settings (such as email server host name, user ID, password, port, and so on). 

In general, the SMTP settings contained in Metadata or the server.xml file are loaded first. (Some SAS applications ONLY use these settings.) Those settings might be overridden by settings in SAS®9 Configuration files. All of these settings are overridden when using OPTIONS or a FILENAME EMAIL statement in SAS code. 

This article does NOT include information about debugging SMTP. For information about debugging SMTP, see SAS KB0040550.

SAS KB0040550 provides a snippet of code that you can use to send a test email. Successfully sending a test email FIRST is useful to verify that the email settings are correct before making email configuration changes in Metadata, server.xml. or .cfg files.

Resolution

Location 1: The Mid-Tier server.xml File

Verify that the values are correct in the server.xml file. server.xml is located in <SAS-configuration-directory>/LevX/Web/WebAppServer/SASServer1_1/conf/.

If the SMTP email server requires authentication, verify the following:

To change email settings for SAS® Studio or other mid-tier web application components, see SMTP Mail Server.

Here is an example:

<SAS-configuration-directory>\Levn\Web\WebAppServer\SASServer1_1\conf\server.xml

<Resource auth="Container" mail.transport.protocol="smtp" mail.smtp.host="smtp.email.com" mail.smtp.starttls.enable="true"  mail.smtp.port="25

     mail.smtp.auth="true" mail.smtp.user="*****" password="***** " mail.debug="true" name="sas/mail/Session" type="javax.mail.Session"  mail.smtp.auth.ntlm.disable="true" mail.smtp.ssl.protocols="TLSv1.2"  />

Location 2: Metadata and SAS® Management Console

Verify that the Email.Host and Email.Port parameter values are correct in SAS Management Console.

  1. Log on to SAS Management Console as the unrestricted user sasadm@saspw.
  2. Select Application Management ► Configuration Manager ► SAS Application Infrastructure.
  3. Right-click SAS Application Infrastructure and select Properties.
    1. Click the Advanced tab.
    2. Verify that the values for Email.Host and Email.Port are correct. If the values are incorrect, double-click the Property Value field and update the values.
  4. Repeat step 3 but select the objects listed under SAS Application Infrastructure:
    1. Check every object for email settings, such as email addresses and host or port settings. Here are two examples:
      • Check Web Administration Console 9.4 for email host and port.
      • Check Search Interface for SAS Content for email addresses.
        Note: These objects might or might not exist based on what applications are currently deployed.

Application Management ► Configuration Manager ► SAS Application Infrastructure ► Properties

Location 3:  Email Settings in SAS9 Configuration Files and Autoexec

  1. From a SAS® Enterprise Guide® or SAS Studio session, run the following code to display the path to all config files loaded for that user's session and current email configuration:

    proc options option=config value; run;

    Note: These config files are listed in the order in which they are loaded in for a session. The contents of the last file will override the others.

    proc options option=emailhost value; run;
    proc options group=email value; run;

  2. Check each file listed in the SAS Log output. (There might be duplicate entries that conflict or cause admin confusion.) 
  3. Verify or make configuration file changes to reflect the new email settings

Location 4: SAS Programs

Statements set in a SAS Program will override settings in config files.

Once you verify all of the above locations, if an email error still occurs in the SAS Log, that individual SAS Program likely contains OPTIONS or FILENAME EMAIL statements.

  1. Check each SAS Program for OPTIONS or FILENAME EMAIL.
  2. Update the settings appropriately.

Additional Information

You must verify all the locations listed above in order to send email through the expected server.