I am trying to get the sender email address of MailItem using Python and win32, but whenever Exchange address is found, I am unable to get the SMTP address. I tried everything available on the net, but it is returning an empty string. Here is the code snippet I'm using:
if msg.Class == 43:
if msg.SenderEmailType == 'EX':
print(msg.Sender.GetExchangeUser().PrimarySmtpAddress)
else:
print(msg.SenderEmailAddress)