Read out sender email address

Add-in Express™ Support Service
That's what is more important than anything else

Read out sender email address
Read sender email address and read internal email address 
Raymond Bolder




Posts: 66
Joined: 2009-06-03
Dear Readers,

I am currently the problem that i can not get the email address form the sender. I am using the folowing piece of code:

MyMailItem = MyItem as Outlook.MailItem;

I can read out the senderName but not his Email address.
How can this be done?

Also i want to read out the email address form a someone within our domain. But when i do this i am getting his internal email address and not the one with the '@'.

Does anyone know how this can be done??

Thanks in advance,

Greets,

Ray
Posted 17 Jun, 2009 12:38:02 Top
Andrei Smolin


Add-in Express team


Posts: 18856
Joined: 2006-05-11
Hello Ray,

I can read out the senderName but not his Email address.


Check the SenderEmailAddress property.

Also i want to read out the email address form a someone within our domain. But when i do this i am getting his internal email address and not the one with the '@'.


See the following sample project - http://www.add-in-express.com/files/projects_pub/olgetsmtpaddressexample.zip.


Andrei Smolin
Add-in Express Team Leader
Posted 17 Jun, 2009 12:49:07 Top
Raymond Bolder




Posts: 66
Joined: 2009-06-03
Hello Andrei,

I do not have this property.
I only have the sendername property.
And not the SenderEmailAddress property.


Below i have a better view of the code maybe something is wrong there.

Outlook.Selection MySelectionObject = MyExplorer.Selection;

                    if (MySelectionObject != null)
                        try
                        {
                            if (MySelectionObject.Count > 0)
                            {
                                try
                                {
                                    MyItem = MySelectionObject.Item(1);
                                    if (MyItem is Outlook.MailItem)
                                    {
                                        try
                                        {
                                            MyMailItem = MyItem as Outlook.MailItem;


For the other problem i will have a look at your example.

Thanx a lot for your support.

Regards Ray
Posted 17 Jun, 2009 17:02:52 Top
Andrei Smolin


Add-in Express team


Posts: 18856
Joined: 2006-05-11
Hello Ray,

Oh,I see. This property was introduced in Outlook 2003. You can create a reply to this e-mail and get the address of the Recipient in the To field. In this way, you get the ReplyTo e-address of the original e-mail, not the From address (it may differ from the ReplyTo address).


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jun, 2009 09:20:09 Top
Raymond Bolder




Posts: 66
Joined: 2009-06-03
Hello Andrei,

I am using outlook 2007. Does this not have this property then?
For now i will try the workaround.

p.s. Do you also know how i can retrieve the unique messageID?

Thanks for your help,

Greets Ray
Posted 18 Jun, 2009 10:12:27 Top
Andrei Smolin


Add-in Express team


Posts: 18856
Joined: 2006-05-11
Ray,

You don't see this property because you use version-neutral interops.

Do you also know how i can retrieve the unique messageID?


See the EntryID property of the outlook item.


Andrei Smolin
Add-in Express Team Leader
Posted 18 Jun, 2009 10:31:38 Top