We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to get Sender email addres for a MailMessage object for outlook2007 (C# .NET)

Hi sir,

        I try to get the sender email address for our purpose using mail message.

strong text
I try this code

       Dim mailMsg1 As Aspose.Email.MailMessage = Aspose.Email.MailMessage.Load(fname)

strsendername = Convert.ToString(mailMsg1.From)

this code work in 2013
but for 2007 not work sender email address not display

Note : I need reply urgent customer is waiting pls reply ASPA


I have observed the issue shared by you. As far as API is concerned there is same namespace used for Outlook 2007 or onward. I request you to please provide the source file along with used sample code that we may test on our end to help you further.

hi mudassir.fayyaz,

i Use sample

dim pathreg as string =“C:\Program Files (x86)\Office Assistant Add-in”

          If Directory.Exists(pathreg + "TempAddin\Outlook") Then

                Dim Dirs6() As String = Directory.GetDirectories(pathreg + "TempAddin\Outlook")

                For Each Dirs1 In Dirs6
                    Dim dinfo22 As New DirectoryInfo(Dirs1)
                    For Each finfo As FileInfo In dinfo22.GetFiles
                        fname = finfo.FullName
                        Dim mailMsg1 As Aspose.Email.MailMessage = Aspose.Email.MailMessage.Load(fname)
                        asdsd = mailMsg1.From.User

                        strsendername = Convert.ToString(asdsd)
            End If

I uppload the sample msg fileasas.zip (3.1 KB)

hi mudassir.fayyaz,

 This one is correct one u check this <a class="attachment" href="/uploads/discourse_instance3/23483">sas.zip</a> (3.4 KB)<a class="attachment" href="/uploads/discourse_instance3/23483">sas.zip</a> (3.4 KB)

sample1.zip (2.7 MB)


Thank you for sharing the information. An issue with ID EMAILNET-39283 has been created in our issue tracking system to further investigate the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


We have investigated the issue on our end. Actually, Outlook 2007 creates not sended MSG file without any information about sender(properties PR_SENDER_EMAIL_ADDRESS or PR_SENT_REPRESENTING_EMAIL_ADDRESS can be found by MFCMAPI or OutlookSpy). So, Aspose.Email can not provide such information.

Please see attached file:
test 2007.zip (10.5 KB)