{*****************************************************} { Notificador de Correos v1.0 © 2009 } { Realizado por Lic. Fernando Leonor (Enecumene) } { Para Delphiaccess ( http://www.delphiaccess.com ) } {*****************************************************} unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdMessageClient, IdPOP3, mmsystem; type TForm1 = class(TForm) IdPOP31: TIdPOP3; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var Estado: Integer; begin {*** Escondemos el form ***} Form1.Width := 100; //Fijamos el ancho del form Form1.Height := 100; //Fijamos el alto del form Form1.Left := -500; //Fijamos la posición del form desde la izquierda Form1.Top := -500; //Fijamos la posición del form desde arriba {*** Fin esconder el form ***} {*** configuramos el servidor POP3 del correo ***} idPOP31.Username := 'Nombre de usuario'; idPOP31.Password := 'Clave del correo'; idPOP31.Host := 'Servidor POP3 del correo'; //pop3.servidor.com {*** Fin ***} {*** conectamos y chequeamos los mensajes ***} idPOP31.Connect; Estado := idPOP31.CheckMessages; idPOP31.Disconnect; {*** Fin ***} {*** verificamos si existen mensajes nuevos o no ***} if Estado = 0 then begin //Si no hay mensajes nuevos PlaySound('C:\WINDOWS\Media\Windows XP Logoff Sound.wav',0,SND_ASYNC); MessageDlg('No tienes mensajes nuevos.',mtInformation,[mbOK],0); end; if Estado = 1 then begin //Si hay sólo un mensaje nuevo PlaySound('C:\WINDOWS\Media\Windows XP Logon Sound.wav',0,SND_ASYNC); MessageDlg('Tienes 1 mensaje nuevo.',mtInformation,[mbOK],0); end; if Estado > 1 then begin //Si hay más de 1 mensaje nuevo PlaySound('C:\WINDOWS\Media\Windows XP Logon Sound.wav',0,SND_ASYNC); MessageDlg('Tienes '+IntToStr(Estado)+' mensajes nuevos.',mtInformation,[mbOK],0); end; {*** Fin ***} {*** Terminamos el programa ***} Application.Terminate; {*** Fin ***} end; end.
Requisitos:
- Indy 9.0
Enjoy !