Last post Oct 16, 2015 03:55 PM by tssarao
Oct 15, 2015 02:11 PM|sudip_inn|LINK
we have mail server in ORCSWeb and we want to design a application which will pull mail from our mail server and save to database. tell me how to pull mail from our mail server and save to database ?
table in db will have fields like From, To, CC, Bcc, Subject and body, send time. after pulling it we want to extract info from mail for From, To, CC, Bcc, Subject and body and sendtime and save to db. when again some one reply that mail then we have save
that replied mail in db but i need to create relation between mail and their reply. guide me how to achieve it. thanks
Oct 15, 2015 04:52 PM|tssarao|LINK
You can use a library link OpenPOP.Net to retrieve POP Emails.
Here is an example to get email from gmail.
// The client disconnects from the server when being disposed
using(Pop3Client client = new Pop3Client())
// Connect to the server
client.Connect("imap.gmail.com", 995, true);
// Authenticate ourselves towards the server
// Get the number of messages in the inbox
int messageCount = client.GetMessageCount();
// We want to download all messages
List<Message> allMessages = new List<Message>(messageCount);
// Messages are numbered in the interval: [1, messageCount]
// Ergo: message numbers are 1-based.
// Most servers give the latest message the highest number
for (int i = messageCount; i > 0; i--)
// Now return the fetched messages
Oct 16, 2015 12:31 AM|pprasannak|LINK
Here is similar post on this
Reading Email from Exchange Server and Save It on SQL Database
Also take a look at this approach that uses outlook
Oct 16, 2015 08:54 AM|sudip_inn|LINK
@pprasannak my main concern is how to store mail id with relation.
suppose user1 one send mail to this address email@example.com and my c# apps will download the mail and save it to db.
when vsdev give answer to firstname.lastname@example.org then how to download that mail and save in db with relation. so when we will display all mail for
email@example.com then we can show and arrange mail with order as a result user can understand what was the first and what was 2nd mail with answer and so on.
would you be able to guide me. thanks
Oct 16, 2015 08:55 AM|sudip_inn|LINK
i just need more help. so i post a another question to @pprasannak. please see and help me if you know the answer @tssarao.
Oct 16, 2015 03:55 PM|tssarao|LINK
OpenPOP Message has properties like MessageID and In-Reply-To which can help you. Each message has a MessageID and if the message is in reply to another email it will have InReplyTo property populated. Please go through the documentation at