How to access latest mail from a specific sender in outlook using python script
<p>Using the following code, I am able to access the latest mail from outlook. But I want to access the latest mail from a particular sender.</p>

<pre><code>import win32com.client

win32com

inbox = outlook.GetDefaultFolder(6) # "6" refers to the index of a folder - in this case,
                                    # the inbox. messages = inbox.Items
message = messages.GetLast()
body_content = message.body
print body_content
</code></pre>

<p>I have seen the following code to get the sender's address. But I am unable to get the latest mail from that address using <code>Getlast()</code> </p>

<pre><code>for m in messages:
   if m.SenderEmailAddress == 'some_sender@somewhere.com':
       print(m)
</code></pre>