首页  编辑  

MPI发送邮件

Tags: /超级猛料/Network.网络通讯/电子邮件/   Date Created:

var

 MapiMessage: TMapiMessage;

 MError: Cardinal;

begin

 with MapiMessage do

 begin

   ulReserved := 0;

   lpszSubject := nil;

//    lpszNoteText := PChar(RichEdit1.Lines.Text);

    lpszNoteText := PChar('fuck');

   lpszMessageType := nil;

   lpszDateReceived := nil;

   lpszConversationID := nil;

   flFlags := 0;

   lpOriginator := nil;

   nRecipCount := 0;

   lpRecips := nil;

   nFileCount := 0;

   lpFiles := nil;

 end;

 MError := MapiSendMail(0, 0, MapiMessage,

   MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);

 if MError <> 0 then MessageDlg(SSendError, mtError, [mbOK], 0);

还可以自己对错误进行处理