Desktop productivity for business analysts and programmers

sending emails with attachment from sas

Reply
New Contributor
Posts: 3

sending emails with attachment from sas

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?

SAS Employee
Posts: 199

Re: sending emails with attachment from sas

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

New Contributor
Posts: 3

Re: sending emails with attachment from sas

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.

 

SAS Employee
Posts: 199

Re: sending emails with attachment from sas

Hi @PMNMatos

 

Can't you use the DATA step to send email then?

What is your constraint?

 

Cheers,
Damo

New Contributor
Posts: 3

Re: sending emails with attachment from sas

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 

SAS Employee
Posts: 199

Re: sending emails with attachment from sas

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

Ask a Question
Discussion stats
  • 5 replies
  • 174 views
  • 0 likes
  • 2 in conversation