Hi All,
I urgently require a generic sas macro code for sending emails through SAS.
Please provide code and possible solutions to this problem.
Thanks and Regards,
Hi,
When i run this above macro code, it gives following error:
ERROR: Email: The connection was refused
Regards
You need to configure SAS with a valid email system so that it can actually work:
The following examples show how you can send e-mail by using SMTP from a DATA step and how you can send your ODS HTML output as HTML and not as an attachment to your e-mail.
To use SMTP you need an SMTP e-mail server that you can access.
To configure SAS to use SMTP, add these system options to your configuration file:
Ask your system administrator for the location of your.email.server.com. Port 25 is the most common port.
The following code uses the FILENAME statement and a DATA step to send e-mail:
filename mymail email from="yourid@email.com" to="id1@.emailaddr.com" "id2@emailaddr.com") subject="Put Subject Here" content_type="text/html"; data _null_; file mymail; put 'hello world'; run; quit;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.