Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: Download attachments files from gmail

$
0
0
Hi luperxe,

once you download the message using MessageFetchMode.Attachments, there is no need to download each attachment separately again. Try to change your code as following:
if (mensaje.From.Address.Equals("mymail@gmail.com") && mensaje.Attachments[0].ContentType.MediaType.Equals("application/pdf"))
{
    listaMensajes.Add(mensaje);
    //mensaje.Seen = true;
    mensaje.Attachments[0].Download();
    string nombreFichero = mensaje.Attachments[0].FileName; 
    byte[] fichero = mensaje.Attachments[0].FileData;
}
Greets,

Pavel

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>