Date
Subject
Body
From
To
CC
Plaform : C#
i want to get single and multiple params from eml file.please provide solution
Date
Subject
Body
From
To
CC
Plaform : C#
i want to get single and multiple params from eml file.please provide solution
@mukundmalpaniweb,
To read the headers and body of an EML file, please use the next code example:
using (var message = MailMessage.Load("example.eml"))
{
Console.WriteLine("Date: " + message.Date);
Console.WriteLine("Subject: " + message.Subject);
Console.WriteLine("From: " + message.From);
// display all message receivers
Console.Write("To: ");
foreach (var address in message.To)
{
Console.Write(address + " ");
}
Console.WriteLine();
// display all copy receivers
Console.Write("CC: ");
foreach (var address in message.CC)
{
Console.Write(address + " ");
}
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("Text body: ");
Console.WriteLine(message.Body);
}
More examples: Loading and Saving Message
API Reference: MailMessage Class