BookmarkSubscribeRSS Feed
Abraham
Obsidian | Level 7

Hello Everyone!

While sending the email through SAS, I am not able to find a copy of sent mail anywhere.

Is there any option or any modification in the below program to locate the sent mail, which mainly required for validation purpose.

Please help.of

FILENAME Mailbox EMAIL  to=("manager@cisco.com")

Subject="Router configuration"

ATTACH= "C:\a.txt"

DATA _NULL_;

FILE Mailbox;

PUT "Hello";

RUN;

6 REPLIES 6
Quentin
Super User

Hi,

It might be easier just to cc/bcc yourself.

I think the location of the sent mail depends on how your mail server is set up. 

Are you running this on PC SAS? Or a server? What OS?  That information might help others help you, as well as your settings for emailsys (SMTP?)

--Q.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Abraham
Obsidian | Level 7

Thanks for the quick response.

Just like in Microsoft Outlook, while sending an email, a copy of it is automatically stored in the 'sent items' . Is it not possible to get a copy like this as I have no idea how to find.

I am running the tool in the Server.

Quentin
Super User

SAS is running on a server, right?  Is it a windows server, or a linux server or some other OS?

If you were running PC SAS, it can actually send the emails via Outlook.  But since you're running on a server, and probably one where outlook is not installed, it goes a different route.  The actual route will depend on your OS and how the mail is setup.  Might be something to ask your SAS administrator.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
overmar
Obsidian | Level 7

Abraham,

I send a daily and weekly email based on a report and had the same issue of it not showing up in my sent items folder of outlook.

I send these reports as a scheduled task so it may differ if you were to send it in a normal SAS session rather than a batch. The thing is if you were to cc yourself on the email (which I do) you will see that the email is actually being sent from "overmar@</computer or server id/> on behalf of overmar@ccf.org", which means that although it is routed through your email, its not really routed through outlook (see below for actual outlook header). So the easiest thing likely is cc yourself on the email so at least you then have a copy of the email being sent.

overmar
Obsidian | Level 7

One other thing although this won't get an email into your sent box, you can save the log from the submitted program which will tell you if the email was sent. This is what the log file looked like from the above email:

NOTE: The file TSC is:

      E-Mail Access Device

Message sent

      To:          "xxxx@xxx.org"

      Cc:          "overmar@ccf.org"

      Bcc:        

      Subject:     Tscores for Thursday, Jan 2, 2014

      Attachments: "xxxx.pdf"

NOTE: 9 records were written to the file TSC.

      The minimum record length was 0.

      The maximum record length was 151.

NOTE: The data set WORK.NULL has 1 observations and 0 variables.

NOTE: DATA statement used (Total process time):

      real time           0.81 seconds

      cpu time            0.04 seconds

In the log file if it says "Message Sent" then you can reasonable infer that the message was in fact sent even without a copy of it in sent items.

jakarman
Barite | Level 11

Of couse there will be no copy in the "sent items" of your mail-program. 

You are not using that mail-program but instead using the real mail-interface (SMTP).
That copy can only be created if the mail-provider (server proces) handling that mail is doing that for you.

---->-- ja karman --<-----

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1084 views
  • 3 likes
  • 4 in conversation