Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outlook SendUsingAccount is null when send drafted mail

I'm using MailItem.SendUsingAccount to get address of sender. But when I try sending a draft mail, the SendUsingAccount become null, while SenderEmailAddress still has value (but not the email address, it's Exchange property).

So why SendUsingAccount is null? And is there any alternative way to get email address of sender?

like image 204
Thanhma San Avatar asked Mar 20 '23 01:03

Thanhma San


1 Answers

SendUsingAccount can be null if the property was not explicitly set. In that case you can fall back to Application.Session.CurrentUser.

like image 103
Dmitry Streblechenko Avatar answered Apr 02 '23 13:04

Dmitry Streblechenko