Extract Images

Oct 18, 2010 at 7:39 PM

Hi.am Gigin,

Thanx in Advance...

I can download my mails from pop server..but..how can i extract embedded images from my mails

Coordinator
Oct 20, 2010 at 5:13 PM

You can get image (or attachment file) by Contents property of Pop3Message class.
Pop3Contents class has a method to save the file data to local storage.

regard.

Nov 23, 2010 at 9:07 AM
Edited Nov 24, 2010 at 3:50 PM

yezzz....i can download that attachment files...but..the problemm is ..i wontbe able to download the image in the messagecontent

 

Thank u

Coordinator
Nov 27, 2010 at 8:39 PM

Does embedded image(in the messagecontent) means that the url in your message?
If so,you must download image file from url by using HttpWebRequest,HttpWebReponse object.

Dec 1, 2010 at 4:02 AM

Hi

In gmail..we can insert image to body .(..not as an attachment ).so the reciever willl get that mail with that image .With our pop3 class ..i can download that type of mail as a text or an html text , der is no url. instead of url ,only image name is der with a square braces ( image  [DCO911 ] ). ACtually i want to download that image

 

.help me pleaseeeeeeeee.

 

Coordinator
Dec 1, 2010 at 10:14 PM

OK.I understand.
Please send me a mail that has image in body to higuchihiguchihiguchi@hotmail.com.
I'll check it.

Dec 6, 2010 at 12:28 PM

hi,,

 

 

u got that mail ?

Coordinator
Dec 6, 2010 at 4:07 PM

Sorry,last week I'm busy on my company...

Anyway,I got your mail and analyzed.
This mail include three mime content.
You can get your image file like below.

Pop3Client cl = new Pop3Client();
//set property of Pop3Client object
Pop3Message mg = cl.GetMessage();
foreach(var ct in mg.Contents)
{
     if (ct.ContentType.Value == "image/jpeg")
    {
        ct.DecodeData("C:\MyFolder\Myfile.jpeg");
    }
}

regard

Dec 6, 2010 at 4:09 PM

thanks for your great response......realyy...thank u very much...

i will try with this code...

thankss

Dec 6, 2010 at 4:44 PM

hi highty,,.

 

code is working.now am able to download the contentss..........

 

thankuuuuuuuuu..very muchhh...

 

 

 

Coordinator
Dec 7, 2010 at 10:58 AM

I'm happy to help you!!

Dec 14, 2010 at 1:58 PM

hi hightyy..

Is it possible to develop an application like outlook..i can download the attachments mails and view the contents with your Higuchi...i hav one doubt dat is i want to display that mail content like in outllookk

 

Coordinator
Dec 15, 2010 at 2:20 PM

It is out of role that C#Mail deal with.
And perhaps I can't catch your need exactly what like outlook.
But I suggest some of guidelines probably it would help you to achieve it.

Mail have two format,one is plain text and another is html format.
You can check the format by ContentType property of Pop3Content object.
Probably outlook shows html mail graphycally with browser functionality.
You can use browser control to show html format mail.
Pop3Content object include string with html format.
Save this html text to local folder.
And set this file to browser control.

Other way is save image file to local.
And use image control to show the image file.



regard.