TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vuk Stanojevic
1.3k
140
45k
C# show emails in listview
Mar 25 2020 9:10 AM
Hi everyone,
im trying to show all my emails from mail.live.com in listview.
I try with follwoing code, but nothing happen.
Can you help me please?
ExchangeService exchange = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
exchange.Credentials = new WebCredentials("emailaddress", "password", "mail.live.com");
exchange.AutodiscoverUrl("emailadress");
if (exchange != null)
{
FindItemsResults<Item> result = exchange.FindItems(WellKnownFolderName.Inbox, new ItemView(1000));
foreach (Item item in result)
{
EmailMessage message = EmailMessage.Bind(exchange, item.Id);
string from = message.From.ToString();
string body = message.Body.Text;
try
{
ListViewItem item1 = new ListViewItem(from);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
Reply
Answers (
3
)
How to detect word from database in message from user.
Converting pseudocode to C#