0 votes

Hello, im working on an application in asp.net mvc, and im stucked at download. I did it before with a forms application, but now i dont have a clue how should i do it because emails are not stored yet.

Is it possible to create a download module in mvc?

foreach (MailBox m in email.From)
{
    fileName = string.Format("" +_folderPath + @"\email_{0}{1}.eml",
        counter, 
        m.Address);
    fileName = fileName.Replace(@"\\", @"\");
    File.WriteAllBytes(fileName, eml);
}

Are there any alternative to do this? Or some documentation where i can start from?

Regards

closed with the note: There is no need to specify path, when downloading messages.
by (420 points)
closed by
I'm not sure what you mean by 'emails are not stored yet'. If you want to download emails use Imap instance and GetMessageByUID method.
Well, to download messages the mvc need a download path, but im not sure what i need to enter.
I don't understand why you need a path?

Imap class downloads messages from the server, to memory.

You can then write them to disk (although database would be a better place), but that's certainly not necessary to parse them using MailBuilder.
...