Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Send email via msoutlook (https://www.delphipraxis.net/176583-send-email-via-msoutlook.html)

question 15. Sep 2013 12:59

Send email via msoutlook
 
Hi,
i am usung the following example code to send email via msoutlook,but i got the error "vorgang abgebrochen"
Code:
procedure TPersoncon.SendmailClick(Sender: TObject);
const
  olMailItem = 0;
var
  Outlook: OLEVariant;
  Mail: Variant;
  MailInspector : Variant;
  stringlist : TStringList;
begin
  try
   Outlook:=GetActiveOleObject('Outlook.Application') ;
  except
   Outlook:=CreateOleObject('Outlook.Application') ;
  end;
  try
    Stringlist := TStringList.Create;
    Mail := Outlook.CreateItem(olMailItem) ;
    Mail.Subject := 'subject';
    Mail.Recipients.Add('email@email.de');//Here i got the error "vorgang abgebrochen"
    Mail.Attachments.Add('attachemnt');
    Stringlist := TStringList.Create;
    StringList.Add('Details');
    MailI.Body := StringList.text;
    MailInspector := MailItem.GetInspector;
    MailInspector.display(true);
  finally
    Outlook := Unassigned;
    StringList.Free;
  end;
end;

Perlsau 15. Sep 2013 13:26

AW: Send email via msoutlook
 
Every week I see this question in one of the Delphi forums. Why not asking Google?


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:23 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz