Einzelnen Beitrag anzeigen

a.vollmer
(Gast)

n/a Beiträge
 
#2

Re: auf Button klicken und eine mail verschicken

  Alt 7. Mai 2004, 21:59
Hier ein Auszug (Procedure) aus den Indy's!

Delphi-Quellcode:
procedure TfrmMessageEditor.bbtnOkClick(Sender: TObject);
begin
   with IdMsgSend do
      begin
         Body.Assign(Memo1.Lines);
         From.Text := UserEmail;
         ReplyTo.EMailAddresses := UserEmail;
         Recipients.EMailAddresses := edtTo.Text; { To: header }
         Subject := edtSubject.Text; { Subject: header }
         Priority := TIdMessagePriority(cboPriority.ItemIndex); { Message Priority }
         CCList.EMailAddresses := edtCC.Text; {CC}
         BccList.EMailAddresses := edtBCC.Text; {BBC}
         if chkReturnReciept.Checked then
            begin {We set the recipient to the From E-Mail address }
               ReceiptRecipient.Text := From.Text;
            end
         else
            begin {indicate that there is no receipt recipiant}
               ReceiptRecipient.Text := '';
            end;
      end;

  {authentication settings}
   case SmtpAuthType of
      0: SMTP.AuthenticationType := atNone;
      1: SMTP.AuthenticationType := atLogin; {Simple Login}
   end;
   SMTP.Username := SmtpServerUser;
   SMTP.Password := SmtpServerPassword;

   {General setup}
   SMTP.Host := SmtpServerName;
   SMTP.Port := SmtpServerPort;

   {now we send the message}
   SMTP.Connect;
   try
      SMTP.Send(IdMsgSend);
   finally
      SMTP.Disconnect;
   end;
end;
unter http://www.nevrona.com/indy findest du evtl. passende Demos!

Gruß

Alex
  Mit Zitat antworten Zitat