<?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: Error Handling With Sending Emails (Checking whether an email sent successfully) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-Handling-With-Sending-Emails-Checking-whether-an-email/m-p/476249#M286066</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181365"&gt;@yus03590&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I believe you're dealing with an asynchronous process and the only thing you can get is the response that your request for sending an email was successful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would need to find a way to query the email server directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find quite a few non-SAS related discussions on the Internet around this topic. If any of these can give you a solution approach will depend on your level of access to the email server.&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jul 2018 03:02:41 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-07-08T03:02:41Z</dc:date>
    <item>
      <title>Error Handling With Sending Emails (Checking whether an email sent successfully)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Handling-With-Sending-Emails-Checking-whether-an-email/m-p/476081#M286065</link>
      <description>&lt;P&gt;Hi!&amp;nbsp; I'm trying to add logging function to an automated report that specifies whether an email was sent successfully.&amp;nbsp; I'm currently using the filename...email method as shown below and the code works.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename outbox email
			%if &amp;amp;debug_flag = 0 %then %do;
				to=&amp;amp;to_emails
			%end;
			%else %do;
				to='Smith, John &amp;lt;someemail@myuniversity.edu&amp;gt;' /* debug email list */
			%end;
			from='Smith, John &amp;lt;someemail@myuniversity.edu&amp;gt;' 
			bcc=&amp;amp;bcclist
			sender='Smith, John &amp;lt;someemail@myuniversity.edu&amp;gt;' 
			reply='Smith, John &amp;lt;someemail@myuniversity.edu&amp;gt;' 
			content_type="text/html"
		%if &amp;amp;wrapup_exit_status = 0 %then %do;
			attach=("&amp;amp;rptpath/&amp;amp;rptfn"
					ENCODING='utf-8'
					CONTENT_TYPE='application/pdf'
					EXTENSION='pdf'
			)
			subject="Entrance Reports &amp;amp;deptnm MTC &amp;amp;rptwk"
		;
		ods html5 style=pearl body=outbox /* Mail it! */;
		proc odstext;
			p 'Hello, ';
			p 'The highlight table at the front includes anyone that responded with information that could be important to know. The following items cause an employee to appear:';
			list
				item 'Marked any need in the special needs section';
				item 'Have been a service member less than 3 years';
				item 'Individuals older than 27';
				item 'Indicated both struggling in training';
				item 'Indicated both not having attended high school';
			end;
		%end;
		%else %do;
subject="Entrance Reports &amp;amp;deptnm &amp;amp;rptwk"
		;
		ods html5 style=pearl body=outbox /* Mail it! */;
		proc odstext;
			p 'Hello, ';
			p 'There are no individuals which have been flagged with special needs this week';
		%end;
			p 'Let me know if you have any questions';
		run;

		ods html5 close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Usually for procedures I can simply check &amp;amp;syserr.&amp;nbsp; However from what I gather when email information is sent to the email server the server simply accepts the request and doesn't send status codes (like if the email had an invalid address).&amp;nbsp; Is there a way to work around this?&amp;nbsp; I just need to know whether an email sent successfully, not specific details.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jul 2018 17:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Handling-With-Sending-Emails-Checking-whether-an-email/m-p/476081#M286065</guid>
      <dc:creator>yus03590</dc:creator>
      <dc:date>2018-07-06T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Error Handling With Sending Emails (Checking whether an email sent successfully)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-Handling-With-Sending-Emails-Checking-whether-an-email/m-p/476249#M286066</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181365"&gt;@yus03590&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I believe you're dealing with an asynchronous process and the only thing you can get is the response that your request for sending an email was successful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would need to find a way to query the email server directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find quite a few non-SAS related discussions on the Internet around this topic. If any of these can give you a solution approach will depend on your level of access to the email server.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2018 03:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-Handling-With-Sending-Emails-Checking-whether-an-email/m-p/476249#M286066</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-07-08T03:02:41Z</dc:date>
    </item>
  </channel>
</rss>

