Good afternoon,
Lately I've found a great deal of value in automating emails for my report outputs. In my SAS programs, I have been specifying the from=('first.last@domain.com'), and therefore the automated emails show up as from first.last@domain.com.
However, within our company outlook defaults, emails are sorted as "LastName, FirstName". When a business user searches for one of my reports, they do not appear sorted with my regular emails because of the difference in displayed names. This prompts the user to ask me to resend my report to them, or they don't even realize I already sent the ad-hoc report.
After researching the issue, I found that you can specify a display name by putting the email address in angle brackets (ref1 below). However, if I use Last, First with a comma, the first name is ignored and the email comes from LastName only.
from = ('Last, First <first.last@domain.com>')
----> Email shows up from "Last"
I've tried other variations of nested quotes with no luck, such as from = ('"Last, First" <first.last@domain.com>')
Any ideas how I can get the email send to properly display as "Last, First" within outlook?
I'm using outlook 2010 32-bit, SAS EG 7.1 HF1, sas server 9.4
ref1 - filename statement reference
I did a little digging and found that most mailers (SMTP especially) use commas and other characters as delimiters and won't allow you to place them in the "From" field. This isn't SAS stripping them out -- it's the SMTP libraries (probably) that are at work under the covers.
The only workarounds I've seen involve changing the mailer programs to allow the commas, but I don't think you have access to do that in this case.
Of course you can omit the comma, and that will support your sorting. But I understand that's not the display experience that you want.
I did a little digging and found that most mailers (SMTP especially) use commas and other characters as delimiters and won't allow you to place them in the "From" field. This isn't SAS stripping them out -- it's the SMTP libraries (probably) that are at work under the covers.
The only workarounds I've seen involve changing the mailer programs to allow the commas, but I don't think you have access to do that in this case.
Of course you can omit the comma, and that will support your sorting. But I understand that's not the display experience that you want.
I was afraid of this - thanks for the research. I held on to some hope because the email was still being processed correctly, but only the comma-firstname portion was being dropped, so I thought that maybe there would be a clever nested quote or escape character trick that I hadn't unearthed in my searching.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.