Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i wrote this code.i am not getting body.please tell me how to get the email body and attachment
My code:
C#
IMAP_Client Client = new IMAP_Client();  
Client.Connect("imap.gmail.com", 993, true);
                Client.Login("bdemailreader@convate.com", "xxxxxxxxxxx");
                if (Client.IsConnected)
                {
                    MessageBox.Show("Client is connected");
                    Client.SelectFolder("INBOX");
                    IMAP_SequenceSet sequence = new IMAP_SequenceSet();
                    
                    //sequence.Parse("*:1"); // from first to last
                    IMAP_Client_FetchHandler fetchHandler = new IMAP_Client_FetchHandler();
                    

                    fetchHandler.NextMessage += new EventHandler(delegate(object s, EventArgs event1)
                    { });
                    
                    fetchHandler.Envelope += new EventHandler<eventargs><imap_envelope>>(delegate(object s, EventArgs<imap_envelope> event2)

                    {
                        IMAP_Envelope envelope = event2.Value;
                        if (envelope.From != null && !String.IsNullOrWhiteSpace(envelope.Subject))
                        {
                            
                            MessageBox.Show(envelope.To[0].ToString());
                            
                            
                            i = i + 1;
                        }

                    });
                    fetchHandler.UID += new EventHandler<eventargs><long>>(delegate(object u, EventArgs<long> event3)
                        {
                            long Uid = event3.Value;
                        });


try:-
i cannot create a constructor.i have to assing the value.what value i have to assign?
public class IMAP_Client_Fetch_Body_EArgs : EventArgs

`
Posted
Updated 18-Oct-13 21:20pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900