Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. mail delete from pop3 mail server using C#

mail delete from pop3 mail server using C#

Scheduled Pinned Locked Moved C#
csharpsysadmin
17 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K khosnur

    would you help me by C# code thanks

    M Offline
    M Offline
    monstale
    wrote on last edited by
    #7

    yes of course, just send the code and the question. :-)

    K 1 Reply Last reply
    0
    • K khosnur

      would you help me by C# code thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #8

      What he's saying is, do your own work. He's told you how it's done, if you can't even try to do it based on this, then you should consider doing a programming course, so you can one day hope to be a programmer.

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      K 1 Reply Last reply
      0
      • M monstale

        yes of course, just send the code and the question. :-)

        K Offline
        K Offline
        khosnur
        wrote on last edited by
        #9

        //my method it works but mail is not deleted Spartan.Net.Mail.POP3 objPOP = new Spartan.Net.Mail.POP3(); objPOP.Connect(Properties.Settings.Default.POP3Server, Properties.Settings.Default.POP3Port, frmLogin._currentUser.fldUserEmail, password); try { objPOP.DeleteMessage(_ReceiveMailNumber); return true; } catch(Exception ex) { XtraMessageBox.Show(ex.Message.ToString()); return false; } //connection code public MAIL_ERROR Connect(string host, int port, string username, string password) { try { _conn.Host = host; _conn.Port = port; _conn.Connect(); System.Threading.Thread.Sleep(_TimeOut); return Login(username, password); } catch (Exception e) { System.Diagnostics.Trace.Write(e.ToString()); return MAIL_ERROR.ERROR_CANTCONNECT; } } //i send mail receive number public MAIL_ERROR DeleteMessage(int id) { if (this._state != POP3_STATE.POP3_LOGGEDIN) { throw new MailException("You are not logged into the mail server"); } string ret = ""; SendCommandSynchronous(string.Format("DELE {0}\r\n", id), out ret, false); if (ret.Contains("OK") == false) { throw new MailException(ret); } else { return MAIL_ERROR.ERROR_NONE; } } private MAIL_ERROR SendCommandSynchronous(string cmd, out string response, bool bMultiLineResponse) { // Remove any data that was left over on the buffer string deadData = _conn.Receive(); _conn.Send(cmd); response = WaitForResponse(bMultiLineResponse); return MAIL_ERROR.ERROR_NONE; } private string WaitForResponse(bool bMultiLine) { int timeout = 5000; // wait 10 seconds for response int waitedTime = 0; string strRet = ""; while (waitedTime < timeout) { System.Threading.Thread.Sleep(_TimeOut); strRet += _conn.Receive(); if (CommandComplete(strRet, bMultiLine) == true)

        1 Reply Last reply
        0
        • C Christian Graus

          What he's saying is, do your own work. He's told you how it's done, if you can't even try to do it based on this, then you should consider doing a programming course, so you can one day hope to be a programmer.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          K Offline
          K Offline
          khosnur
          wrote on last edited by
          #10

          hi cristian graus, its really very good news that u r only programmer in the world who's programming knowledge is like God. u can tell u as second god. Shafik

          C 1 Reply Last reply
          0
          • K khosnur

            hi cristian graus, its really very good news that u r only programmer in the world who's programming knowledge is like God. u can tell u as second god. Shafik

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #11

            khosnur wrote:

            its really very good news that u r only programmer in the world who's programming knowledge is like God. u can tell u as second god.

            Well, I can program, AND I can spell. I can even use google. If I ask for help, I tend to first try to think for myself and ask questions where I tell people what I've tried instead of asking them to send me code. This does not make me 'god', but I guess it does make me working for a real wage in the real world, instead of being hired because I am cheap, by people who don't realise I am not worth it.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            K 1 Reply Last reply
            0
            • C Christian Graus

              khosnur wrote:

              its really very good news that u r only programmer in the world who's programming knowledge is like God. u can tell u as second god.

              Well, I can program, AND I can spell. I can even use google. If I ask for help, I tend to first try to think for myself and ask questions where I tell people what I've tried instead of asking them to send me code. This does not make me 'god', but I guess it does make me working for a real wage in the real world, instead of being hired because I am cheap, by people who don't realise I am not worth it.

              Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

              K Offline
              K Offline
              khosnur
              wrote on last edited by
              #12

              Graus, i think u dont see that i thought and i up;oad my code but it doesnt work. why i dont know would u see.... then complement.... Shafik

              K C 2 Replies Last reply
              0
              • K khosnur

                Graus, i think u dont see that i thought and i up;oad my code but it doesnt work. why i dont know would u see.... then complement.... Shafik

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #13

                It looks to me like you're using some sort of third party library. What error you get, is still a mystery. No-one can help based on that lack of information.

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                K 2 Replies Last reply
                0
                • K khosnur

                  Graus, i think u dont see that i thought and i up;oad my code but it doesnt work. why i dont know would u see.... then complement.... Shafik

                  K Offline
                  K Offline
                  Keith Barrow
                  wrote on last edited by
                  #14

                  Please read the sticky at the top of the thread "How to get an answer to your question". So far you have broken rules: 2, 4, 7 8 pretty close to breaking 11 and also the unwritten rule about not using textspeak in message boards. 99.9% of the people on the message boards are unpaid and helping as an act of altruism. We are not here to supply you with code, just helping to provide guidance. You should ask a specific question or ask about a specific fault, otherwise you aren't going to get a better answer than the ones you have.

                  K 1 Reply Last reply
                  0
                  • K Keith Barrow

                    Please read the sticky at the top of the thread "How to get an answer to your question". So far you have broken rules: 2, 4, 7 8 pretty close to breaking 11 and also the unwritten rule about not using textspeak in message boards. 99.9% of the people on the message boards are unpaid and helping as an act of altruism. We are not here to supply you with code, just helping to provide guidance. You should ask a specific question or ask about a specific fault, otherwise you aren't going to get a better answer than the ones you have.

                    K Offline
                    K Offline
                    khosnur
                    wrote on last edited by
                    #15

                    please dont misunderstand me. i upload my code. but grause complement me without see that code.its really unwanted. thanks

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      It looks to me like you're using some sort of third party library. What error you get, is still a mystery. No-one can help based on that lack of information.

                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                      K Offline
                      K Offline
                      khosnur
                      wrote on last edited by
                      #16

                      Graus, i supply the mail receive number which i got when i received mail.interesting it shows no error when i debug. but mail is not deleted. would u help me by any ires thanks in advance

                      1 Reply Last reply
                      0
                      • C Christian Graus

                        It looks to me like you're using some sort of third party library. What error you get, is still a mystery. No-one can help based on that lack of information.

                        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                        K Offline
                        K Offline
                        khosnur
                        wrote on last edited by
                        #17

                        motherchod reply des na ken?

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups