mail delete from pop3 mail server using C#
-
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.
-
//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)
-
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.
-
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
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.
-
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.
-
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
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.
-
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
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.
-
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.
-
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.
-
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.