I am getting unread email message from the outlook and tried to print the list value in immediate panel but it’s only showing “System.Collections.Generic.List`1[System.Net.Mail.MailMessage]”. The list contains data and can be obtained in the loop but not able to print the whole list
Could someone suggest a possible solution for this.
The Immediate panel might not display the content of complex objects directly, so you need to extract and print the information
If you want to view the content of each email message in the list within the Immediate panel, you can iterate through the list and print the details of each message one by one.
If you want count of emails then MailMessage.Count
If you want to read the body of mail then in For Each currentItem.Body
If you want to read the subject of mail then in For Each currentItem.Subject
Cheers!!
Instead of printing whole Mail Message you can split the Mail Messages into parts and print it in message Box.
currentItem.Subject.Tostring will print Subject
currentItem.Body will print the body
currentItem.SenderEmailAddress will print sender email address
Like this way you can print in message box.
Regards
You can use Loop for get all the details like Subject, From address, Body etc.
For check all in Immediate Panel according to your Question.
Use below expression in Immediate Panel or Message Box
String.Join(Environment.NewLine, MailList.Select(Function(mailMessage) $“Subject: {mailMessage.Subject}, From: {mailMessage.From.Address}”))
Replace MailList with you variable i.e MailMessage
Hope it will helps you
Cheers!!
Hey, You wont be able to get subject, body by printing the whole message.
Try doing the below :-
currentItem.Subject.Tostring for Subject
currentItem.Body for body
similary , you can print different elements from mails.
yes, I did that and working but my requirement is to see/print the whole data in the mail Message List
Is there any way to print/view the whole data in the mail message list.
Do you want to print the whole Mail message.
You can follow this way and see the entire Mail Message. I have count because If you have two or three mails three text files will get created for three emails.
Regards
@athira.aneesh
If it helps you. Mark my answer as Solution.
Happy Automation
Its working now … Thank you
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.