Description Email notifier is TCP/IP application that notifies the user if there is email in the user's email server. This application checks email in default time interval of 5 minutes. You can change it with configure menu. this application is a Iconfied application. What I mean is that when you run it, it will appear in the right bottom corner as a icon. When you mouse right-click on it, you will seeIf you choose Configure menu, you can configure settings, and you will see then you can configure-POP3 Server-POP3 Server Port-User Name and Password--Time Internal that the application checks emailI suggest you that you should enter these information, before you choose the menu "Check Email"I improved this application by using Microsoft Agent character Genie. Genie will tell you how many emails you have. First of all you have to download Microsoft Agent SDK from the following URL and install it.http://www.microsoft.com/msagent/downloads.htmGenie will pop up and tells you the number of emailthe following code makes Microsoft Agents workpublic frmAgent(int EmailNumber){//// Required for Windows Form Designer support//InitializeComponent();///you can download Agents from///http://www.microsoft.com/msagent/downloads.htm/// first load the characterAgent1.Characters.Load("Genie","Genie.acs");AgentObjects.IAgentCtlCharacterEx genie=Agent1.Characters["Genie"];AgentObjects.IAgentCtlRequest reg;genie.Show(false);genie.Speak("You Have "+ EmailNumber.ToString()+" emails","");genie.Think("Should I Leave or Stay, Himmm!!!!");genie.Hide(true);}Source Code: private void EmailCheck(){TcpClient tcpClient = new TcpClient();try{tcpClient.Connect(txtPopServer.Text,Int32.Parse(txtPopPort.Text));}catch{MessageBox.Show("Cannot connect to target host "+txtPopServer.Text +" and port "+txtPopPort.Text);}///get the response of pop3 mail servernetStream = tcpClient.GetStream();if(netStream == null){throw new Exception("GetStream is null");} string returnMsg=ReadFromNetStream(ref netStream);checkForError(returnMsg);///send username informationWriteToNetStream(ref netStream, "USER " + this.txtUserName.Text);returnMsg=ReadFromNetStream(ref netStream);checkForError(returnMsg);///send password informationWriteToNetStream(ref netStream, "PASS " + this.txtPassword.Text);returnMsg=ReadFromNetStream(ref netStream);checkForError(returnMsg);Stat();netStream.Close();tcpClient.Close();}public void Stat(){WriteToNetStream(ref netStream, "STAT");string returnMsg=ReadFromNetStream(ref netStream);checkForError(returnMsg);///split the information of total message and total sizestring[] TotalStat= returnMsg.Split(new char[] {' '});int count=Int32.Parse(TotalStat[1]);int totalSize=Int32.Parse(TotalStat[2]);///the following code will call the Microsoft Agent (Genie Chracter)frmAgent agent= new frmAgent(count); emailnot.Show();}private void WriteToNetStream(ref NetworkStream NetStream, string Command){string stringToSend = Command + "\r\n";Byte[] arrayToSend = Encoding.ASCII.GetBytes(stringToSend.ToCharArray());NetStream.Write(arrayToSend, 0, arrayToSend.Length);}/// <summary>/// this function reads from Network Stream/// </summary>/// <param name="NetStream"></param>/// <returns></returns>private String ReadFromNetStream(ref NetworkStream NetStream){StringBuilder strReceived= new StringBuilder();StreamReader sr= new StreamReader(NetStream);String strLine = sr.ReadLine();while(strLine==null || strLine.Length==0){strLine = sr.ReadLine();}strReceived.Append(strLine);if(sr.Peek()!=-1){while ((strLine=sr.ReadLine())!=null) { strReceived.Append(strLine);}}return strReceived.ToString();}/// <summary>/// this function checks the error in the stream;/// </summary>/// <param name="s"></param>private void checkForError(String strMessage){if (strMessage.IndexOf("+OK") == -1)throw new Exception("ERROR - . Recieved: " + strMessage);}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: