我用NetCaptor软件可以调用OutLook发送附件?用ShellExecute(handle, 'open','mailto:whz98@263.net?

  • 主题发起人 主题发起人 WebExplorer
  • 开始时间 开始时间
W

WebExplorer

Unregistered / Unconfirmed
GUEST, unregistred user!
我用NetCaptor软件可以调用OutLook发送附件?用ShellExecute(handle, 'open','mailto:whz98@263.net?subject=主题&amp;cc=fengye2000@263.net', Nil, nil, SW_SHOWNORMAL)能实现发送附件吗?(100分)<br />我用NetCaptor软件可以调用OutLook发送附件?用ShellExecute(handle, 'open','mailto:whz98@263.net?subject=主题&amp;cc=fengye2000@263.net', Nil, nil, SW_SHOWNORMAL)能实现发送附件吗? 要求必须调出OutLook,不使用直接发OutLookApplication
 
可以的,&amp;attachment=file1,file2,具体你试试吧
 
yxjdelphi:
我试了一下,好象没有用???我写错了?
可以贴一下你的代码?
 
我记得一个方法,在delphi的Demo中,我去查查,然后在来告诉你。注意它不是用ShellExecute
函数,好像要用一个接口,而且必须设定Outlook为默认邮件才行。类似的方式可以从Winzip中
的发送zip邮件的效果一致。
 
调用方式和定义如下(注意:请引用Mapi单元):
procedure TForm1.FileSend1Execute(Sender: TObject);
var
MapiMessage: TMapiMessage;
MError: Cardinal;
begin
with MapiMessage do
begin
ulReserved := 0;
lpszSubject := nil;
lpszNoteText := PChar(RichEdit1.Lines.Text);
lpszMessageType := nil;
lpszDateReceived := nil;
lpszConversationID := nil;
flFlags := 0;
lpOriginator := nil;
nRecipCount := 0;
lpRecips := nil;
nFileCount := 0;
lpFiles := nil;
end;

MError := MapiSendMail(0, Application.Handle, MapiMessage,
MAPI_DIALOG or MAPI_LOGON_UI or MAPI_NEW_SESSION, 0);
if MError &lt;&gt; 0 then MessageDlg(SSendError, mtError, [mbOK], 0);
end;

定义如下:
type
PMapiFileDesc = ^TMapiFileDesc;
{$EXTERNALSYM MapiFileDesc}
MapiFileDesc = packed record
ulReserved: Cardinal; { Reserved for future use (must be 0) }
flFlags: Cardinal; { Flags }
nPosition: Cardinal; { character in text to be replaced by attachment }
lpszPathName: LPSTR; { Full path name of attachment file }
lpszFileName: LPSTR; { Original file name (optional) }
lpFileType: Pointer; { Attachment file type (can be lpMapiFileTagExt) }
end;

type
PMapiMessage = ^TMapiMessage;
{$EXTERNALSYM MapiMessage}
MapiMessage = packed record
ulReserved: Cardinal; { Reserved for future use (M.B. 0) }
lpszSubject: LPSTR; { Message Subject }
lpszNoteText: LPSTR; { Message Text }
lpszMessageType: LPSTR; { Message Class }
lpszDateReceived: LPSTR; { in YYYY/MM/DD HH:MM format }
lpszConversationID: LPSTR; { conversation thread ID }
flFlags: FLAGS; { unread,return receipt }
lpOriginator: PMapiRecipDesc; { Originator descriptor }
nRecipCount: Cardinal; { Number of recipients }
lpRecips: PMapiRecipDesc; { Recipient descriptors }
nFileCount: Cardinal; { # of file attachments }
lpFiles: PMapiFileDesc; { Attachment descriptors }
end;

使用时,不需在您的文件中定义上述内容,只需引用Mapi单元即可。说明一下,上述定义
及引用方法无法在帮助中找到描述。
 
zqw0117:
我使用lpFiles.lpszPathName:='c:/test.htm';
但好出错,不知道是不是我写的格式不对?????
 
后退
顶部