Hello,
I'm tryig to send an email directly froam SAS, but the system give me this message "ERROR: Email: Permission is denied."
I'm using this code:
filename mymail email "ABC@servidor.pt"
subject="Relatório P348"
from="ABC@servidor.pt"
to="ABC@servidor.pt"
attach="C:\Users\......\Abc.xlsx";
data _null_;
file mymail;
put Texto";
put "Texto.";
run;
I've already run this command:
proc setinit;
run;
And I've obtained this message:
Operating System: WX64_SV .
Product expiration dates:
---Base SAS Software 29JUN2018
---SAS/STAT 29JUN2018
---SAS/GRAPH 29JUN2018
---SAS Integration Technologies 29JUN2018
---SAS/Secure 168-bit 29JUN2018
---SAS/Secure Windows 29JUN2018
---SAS Enterprise Guide 29JUN2018
---SAS/ACCESS Interface to PC Files 29JUN2018
---SAS/ACCESS Interface to ODBC 29JUN2018
---SAS Workspace Server for Local Access 29JUN2018
---High Performance Suite 29JUN2018
---SAS Add-in for Microsoft Excel 29JUN2018
---SAS Add-in for Microsoft Outlook 29JUN2018
---SAS Add-in for Microsoft PowerPoint 29JUN2018
---SAS Add-in for Microsoft Word 29JUN2018
What am I doing wrong?
Can anyone help me?
Hi @PMNMatos
Do it work without the attachment ?
First, are you able to send email outside of SAS?
Please use Usage Note 18363 (Troubleshooting guidelines for successfully sending an SMTP e-mail from SAS® software) and let us know if that works.
Then try to apply this one Usage Note 19767 (Using SAS® software to send SMTP email).
It tells you the option you need to setup, etc. and gives you a sampel code.
Ovreall, Sending E-mail from the DATA step should help you if you can get the above 2 Notes to work.
Hope that helps.
Cheers,
Damo
Hi,
Now I can send an e-mail from the DATA step.
I continue to have some issues with the program.
Thank you for your help.
Hi Damo,
No. Now I don't have any problem sending de e-mail from data step. It's working perfetly.
But I can't send the email with the code I write above. Do you have any idea to solve the problem? (it is no very importante... just curiosity).
Thank you again.
Pedro
Hi @PMNMatos
Great, so you have a solution, that's the main point.
Can you send us the 2 logs files (when it works and the one related to your original program) ?
Cheers,
Damien
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.