To extract Sender email address from .pst file

Hi Team,

I am using Aspose Java api to extract outlook messages from .pst files. Now i am facing issue with to retrieve the sender email address.I am getting abc,123 instead of abc.123@xyz.com.I need the sender email address should be in this format abc.123@xyz.com not this <abc,123 >.

Kindly help on this. Thanks in Advance.

Thanks,
Ragav.S

Hi Ragav.S,


Thank you for writing to Aspose support team.

MapiMessage.getSenderSmtpAdress() function returns the From email address in the required format. Could you please give a try to the following sample code and let us know the feedback?

PersonalStorage pst =PersonalStorage.fromFile(“sample.pst”);

FolderInfo folderInfo = pst.getRootFolder().getSubFolder(“Inbox”);

MessageInfoCollection messageInfoCollection = folderInfo.getContents();

for(MessageInfo info : messageInfoCollection)

{

MapiMessage mapi = pst.extractMessage(info);

System.out.println("Sender Email: " + mapi.getSenderSmtpAddress());

}


Hi Muhammad Waqas,

Thanks for your response.I have tried the above mentioned but i am getting “null”.
Tried the below :
mapi.getSenderSmtpAddress() (output : null)
mapi.getSenderName() (Output : abc,123)
mapi.getSenderRepresentingName() (Output : abc,123)

I am getting the above Output for those commands.But i need the actual email address (abc.123@xyz.com) but still i am unable to get this format. Kindly help on this.

Thanks,
Ragav.S

Hi Ragav.S,


Could you please share your sample PST or MSG File file with us for our testing? We will re-produce the issue here and provide assistance accordingly.