<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: sending emails from sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247029#M46277</link>
    <description>&lt;P&gt;This:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/" target="_self"&gt;http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;may point you in the right direction.&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jan 2016 11:34:40 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-01-30T11:34:40Z</dc:date>
    <item>
      <title>sending emails from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247019#M46276</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options emailsys = smtp 
emailauthprotocol= login
EMAILACKWAIT=30
emailid = 'runnerupwang@outlook.com'
emailpw = 'XXXXXX'
emailhost = 'smtp.live.com' 
emailport = 25 ;
filename f_email email 
to =   '1055103120@qq.com'
from = 'runnerupwang@outlook.com'
subject = 'Automatic Email Sending Test'
;
data _null_;
file f_email;
put 'This is a test email with an RTF attachment via SAS programming.';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I'm trying to send the email in the SAS9.4 with outlook mail, but failed, and I got an error message below, it seems that I should specify SSL, but I don't know how. Thanks for your info&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Login Failed&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ERROR: Email: 530 5.7.0 Must issue a STARTTLS command first&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PS: This code works if I changed the sender to 163 mail, and emaihost to smtp.163.com&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 06:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247019#M46276</guid>
      <dc:creator>Wang_Yajun</dc:creator>
      <dc:date>2016-01-30T06:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247029#M46277</link>
      <description>&lt;P&gt;This:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/" target="_self"&gt;http://blogs.sas.com/content/sasdummy/2013/07/31/gmail-from-sas-program/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;may point you in the right direction.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2016 11:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247029#M46277</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-01-30T11:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247128#M46296</link>
      <description>I suggest you also take a look at the following&lt;BR /&gt;&lt;BR /&gt;Usage Note 53215: How to set up your SAS® installation to use Secure SMTP via Gmail at:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/kb/53/215.html" target="_blank"&gt;http://support.sas.com/kb/53/215.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;More information on the options= emailhost option for SAS V9.4 can be found here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#p1v9dr6zep9p9en1prhl6tdy3igx.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#p1v9dr6zep9p9en1prhl6tdy3igx.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here is some sample code:&lt;BR /&gt;&lt;BR /&gt;options emailsys = smtp&lt;BR /&gt;emailid = 'runnerupwang@outlook.com'&lt;BR /&gt;emailpw = 'XXXXXX'&lt;BR /&gt;emailhost = 'smtp.live.com'&lt;BR /&gt;emailport = 25 ;&lt;BR /&gt;&lt;BR /&gt;options emailhost=&lt;BR /&gt;(&lt;BR /&gt;"smtp.live.com"&lt;BR /&gt;STARTTLS auth=LOGIN&lt;BR /&gt;/* your Outlook address */&lt;BR /&gt;id=" runnerupwang@outlook.com&lt;BR /&gt;/* optional: encode PW with PROC PWENCODE */&lt;BR /&gt;pw="XXXXX" port=587&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;filename f_email email&lt;BR /&gt;to = '1055103120@qq.com'&lt;BR /&gt;from = 'runnerupwang@outlook.com'&lt;BR /&gt;subject = 'Automatic Email Sending Test';&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;file f_email;&lt;BR /&gt;put 'This is a test email with an RTF attachment via SAS programming.';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 31 Jan 2016 21:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247128#M46296</guid>
      <dc:creator>DMO467</dc:creator>
      <dc:date>2016-01-31T21:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247147#M46305</link>
      <description>&lt;P&gt;Thanks for your support. The final solution for sending the email with Outlook Account is similar to&amp;nbsp;your sample code. I have setup the emailhost option in the second part option, I wonder why I have to setup the first part system options.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*First part Option Setup*/&lt;BR /&gt;options 	emailsys 	= 	smtp 
				emailauthprotocol= login
				EMAILACKWAIT=30
				emailid 	=	'******@outlook.com'
				emailpw 	= 	'XXXXXX'
				emailhost = 	'smtp-mail.outlook.com' 
				emailport	=	25 ;
&lt;BR /&gt;&lt;SPAN&gt;/*Second part Option Setup*/&lt;/SPAN&gt;
options emailhost=
 (
   'smtp-mail.outlook.com'  port=587
   STARTTLS  auth=login 
   id='******@outlook.com'
   /* optional: encode PW with PROC PWENCODE */
   pw='XXXXXX'
 )
;
filename f_email email 
	to			=	('OutMail_Address1'  'OutMail_Address2')
	subject	=	'Automatic Email Sending Test'
	attach	=	'C:\Users\Think\Desktop\test.rtf'
	;

data _null_;
	file	f_email;
	put	'This is a test email with an RTF attachment via SAS programming.';
run;

filename f_email clear;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 01:19:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247147#M46305</guid>
      <dc:creator>Wang_Yajun</dc:creator>
      <dc:date>2016-02-01T01:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: sending emails from sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247390#M46381</link>
      <description>The difference between these two is that SMTP over SSL first establishes a secure SSL/TLS connection and conducts SMTP over that connection, and SMTP with STARTTLS starts with unencrypted SMTP and then switches to SSL/TLS. This is why the email STMP system options in the SAS code are specified first, and the email host options STARTTLS are specified second.&lt;BR /&gt;&lt;BR /&gt;Check this post out if you require further information:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://stackoverflow.com/questions/17281669/using-smtp-gmail-and-starttls" target="_blank"&gt;http://stackoverflow.com/questions/17281669/using-smtp-gmail-and-starttls&lt;/A&gt;</description>
      <pubDate>Tue, 02 Feb 2016 09:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sending-emails-from-sas/m-p/247390#M46381</guid>
      <dc:creator>DMO467</dc:creator>
      <dc:date>2016-02-02T09:41:30Z</dc:date>
    </item>
  </channel>
</rss>

