BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nelsonc
Fluorite | Level 6

I have code that sends off an email when the job is completed.

filename outbox1 email 
                   to = ("Group1 <Group1@someplace.com>")
                   cc = ("Group2 <Group2@someplace.com>"
                           )
              emailid = "Group2 <Group2@someplace.com>"
              replyto = "Group2 <Group2@someplace.com>"
              subject = "*** Report Summary Week Ending &lastwkenda ***"
              attach  = "\\blah1\blahblah\blah\ReportSummary.xlsx";
;

The email sends with no errors recorded

However only Group2 receives the email even though the email sent still shows group1 in the to field.

I have verified the spelling of the email address and it is correct, also i am able to send to group1 email through outlook with no problems.

If anyone has any ideas as to why SAS refuses to send to the group1 email please let me know.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
nelsonc
Fluorite | Level 6

Thanks for the suggestions. I figured out that the email id was set to only accept emails from senders inside my organization. I had the IT Dept change the setting for the group and now everything works correctly.

View solution in original post

2 REPLIES 2
jimbarbour
Meteorite | Level 14

Everything looks fine.  If I copy your code into a SAS session and change the email addresses, it sends just fine.

 

The only thing I can think of is that it may have something to do with the group nature of the email address.  If Outlook is doing some kind of a translation behind the scenes, that translation might not happen when sent via the simple SMTP connection that I believe SAS uses.  One way to test this is to try sending a test message to the group address from outside Outlook, say through gmail or yahoo mail or something like that.  If it bounces back, you'll know that the group address you're using is only valid for emails sent entirely within Outlook.  

 

Jim

nelsonc
Fluorite | Level 6

Thanks for the suggestions. I figured out that the email id was set to only accept emails from senders inside my organization. I had the IT Dept change the setting for the group and now everything works correctly.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1037 views
  • 1 like
  • 2 in conversation