Getting the TO field email addresses from a PST

Hello Support,

I am trialing the aspose.total and have almost finished. The last thing that I can’t figure out is getting the TO address’s from an existing msg within a PST.

I am using the following code to retrieve the bcc and cc. Maybe I am missing something? I’ve tried message.DisplayTo but that is just the name and not the email address.

The eml_to var ends up always being the DisplayName.

For Each rec In message.Recipients
'1(or else) = TO 2 = CC 3 = BCC
Select Case rec.RecipientType
Case 2
If eml_cc = “” Then
eml_cc = rec.EmailAddress
Else
eml_cc = eml_cc & “;” & rec.EmailAddress
End If
Case 3
If eml_bcc = “” Then
eml_bcc = rec.EmailAddress
Else
eml_bcc = eml_bcc & “;” & rec.EmailAddress
End If
Case Else
If eml_to = “” Then
eml_to = rec.EmailAddress
Else
eml_to = eml_to & “;” & rec.EmailAddress
End If
End Select
Next

Glen

EDIT: I think the recepient.EmailAddress returns a display name if it was the owner of the PST file. Is this normal?


Hi Glen,


Thank you for contacting Aspose support team.

I have tried to re-produce the scenario by accessing messages in a sample PST. It is observed that proper email addresses are displayed while displaying the recipients information.

Could you please send us the sample PST along with the complete console application which can be compiled and executed here to observe the issue? It will help us to analyze the problem and provide assistance as soon as possible.

I have identified the issue. If the email was sent “on behalf of” another user, I can’t get the sent address.

Glen

Hi Glen,


Thank you for providing feedback. Please feel free to write us back if you have any other query related to Aspose.Email.