AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Flags für MAPI Sendmail Aufruf
Thema durchsuchen
Ansicht
Themen-Optionen

Flags für MAPI Sendmail Aufruf

Ein Thema von runger · begonnen am 21. Okt 2005 · letzter Beitrag vom 21. Okt 2005
 
runger
(Gast)

n/a Beiträge
 
#1

Flags für MAPI Sendmail Aufruf

  Alt 21. Okt 2005, 06:13
Hallo,

wir wollen über eine MAPI Funktion E-mails versenden.
Unser E-mail Client ist Lotus Notes.

Delphi-Quellcode:
function sendMail( const TargetName, TargetAddr,
                         SenderName, SenderAddr,
                         MsgSubject, MsgContent,
                         Attachment : String;
                         PreviewMsg : Boolean = TRUE ) : Integer;
var
  msg : TMapiMessage; // Pointer to the message itself
  mrdSender, // Who's sending it?
  mrdTarget : TMapiRecipDesc; // Who's going to get it?
  mfdAttach : TMapiFileDesc; // The attached file.
  liFlags : Longint; // Flags for MAPI.
  strError : String; // Holds MAPI error results;
begin
 result := 0;
 liFlags := 0;
 fillChar( msg, sizeOf( msg ), 0 );
 with msg do
 begin

// if TargetAddr = '' then
// raise tMailFileException.createFmt( ERROR,
// [ 'Target email address not specified' ] )
   begin
      if TargetName = 'then
         mrdTarget.lpszName := pChar( TargetAddr )
      else
         mrdTarget.lpszName := pChar( TargetName );
      mrdTarget.ulRecipClass := MAPI_TO;
      mrdTarget.lpszAddress := pChar( TargetAddr );
      mrdTarget.ulReserved := 0;
      mrdTarget.ulEIDSize := 0;
      mrdTarget.lpEntryID := NIL;
      nRecipCount := 1;
      lpRecips := @mrdTarget;

   end;

// if SenderAddr = '' then
// raise tMailFileException.createFmt( ERROR,
// [ 'Sender email address not specified' ] )
   begin
      if SenderName = 'then
         mrdSender.lpszName := pChar( SenderAddr )
      else
         mrdSender.lpszName := pChar( SenderName );
      mrdSender.ulRecipClass := MAPI_ORIG;
      mrdSender.lpszAddress := pChar( 'SMTP:' + SenderAddr );
      mrdSender.ulReserved := 0;
      mrdSender.ulEIDSize := 0;
      mrdSender.lpEntryID := NIL;
      lpOriginator := @mrdSender;
   end;

   if MsgSubject = 'then
      lpszSubject := ''
   else
      lpszSubject := pChar( MsgSubject );

// if ( MsgContent = '' ) AND ( Attachment = '' ) then
// raise tMailFileException.createFmt( ERROR,
// [ 'Tried to send an empty message (no content or attachment)' ] )
   begin
      if MsgContent = 'then
         lpszNoteText := 'Please see the attached file.'
      else
         lpszNoteText := pChar( MsgContent );

      if Attachment = 'then begin
         nFileCount := 0;
         lpFiles := NIL;
      end else begin
         fillChar( mfdAttach, sizeOf( mfdAttach ), 0 );
         mfdAttach.nPosition := cardinal( $FFFFFFFF );
         mfdAttach.lpszPathName := pChar( Attachment );
         nFileCount := 1;
         lpFiles := @mfdAttach;
      end;
   end; // with

   if previewMsg then liFlags := MAPI_DIALOG;
   result := mapiSendMail( 0, application.Handle, msg, liFlags, 0 );


{  if result <> 0 then
      raise tMailFileException.createFmt( ERROR,
        [ 'MAPI triggered an error ('
           + getMAPIError( result ) + ')' ] );   }

  end;

end;
Das Ganze funktioniert insoweit, dass E-mails in Notes erzeugt werden, es öffnet sich das normale Mew mail Fenster und ich sehe meine generierte Mail.
Wie krieg ich notes dazu, dass es diese mail auch sendet.
Offensichtlich hat es irgendetwas mit liflags und MAPI_DIALOG zu tun.
Mapi_dialog sthet auf 8, das heisst: trage E-mail ein.
Gefunden hab ich noch die 4 das bedeudet sende E-Mail. Funktioniert aber nicht.
Kann mir jemand helfen?

Die Fehlerabfragen sind auskommentiert.

Rainer
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:07 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