Hallo Willie1,
ich mache das immer mit
Indy-
SMTP:
Code:
procedure TfrmMain.SendMail;
var
AttachmentFile: TIdAttachmentFile;
begin
try
AntiFreeze.Active := True;
Screen.Cursor := crHourGlass;
try
with IndyMessage do begin
Clear;
Organization := CompanyName;
From.Name := FromName;
From.Address := FromAdress;
Recipients.EMailAddresses := ToAdress;
Subject := Bodytext;
ContentTransferEncoding := 'BASE64';
CharSet := 'ISO-8859-1';
Body.Add(BodyText03 + BodyText02 + FormatDateTime('dd.mm.yyyy', dmMain.tblProduktionsberichteProduktionszeitAnfang.AsDateTime) + ' - ' + comboSchicht.Text + ' - ' + comboLinie.Text);
Body.Add('Projektnummer: ' + comboProjektnummer.Text + ' - ' + 'Projektname: ' + comboProjektname.Text + Space + BodyText04);
Body.Add(BodyText05);
Body.Add(BodyText06);
Body.Add(BodyText07);
AttachmentFile := TIdAttachmentFile.Create(MessageParts, AttachmentFileName);
end;
IndySMTP.Host := MailServer;
IndySMTP.Username := MailUser;
IndySMTP.Password := MailPassword;
IndySMTP.Connect;
if IndySMTP.Connected then begin
IndySMTP.Send(IndyMessage);
IndySMTP.Disconnect;
end;
except
if IndySMTP.Connected then
IndySMTP.Disconnect;
Screen.Cursor := crDefault;
FreeAndNil(AttachmentFile);
AntiFreeze.Active := False;
end;
finally
Screen.Cursor := crDefault;
FreeAndNil(AttachmentFile);
AntiFreeze.Active := False;
end;
end;
Vielleicht hilft dir das ja weiter (?)