请教mailto的用法:(100分)

  • 主题发起人 主题发起人 ymqpc
  • 开始时间 开始时间
Y

ymqpc

Unregistered / Unconfirmed
GUEST, unregistred user!
我会用类似的mailto:ymk@163.com?Cc=ymd@sina.com&body=hello!
语句启动OutLook!我发现Winrar有一个功能:把文件压缩后启动OutLook作为E-Mail的附件!但我试了很多次了都不行!我会加Cc(抄送),body(内容),subject(主题),Bcc(暗送).就是不能加附件,请高手指点!附件的关键词是不是(Attach)?
在开始-->运行里输入上面的语句就行了!
 
不用想了,命令行是不支持发附件的(即使支持也只是某种发件软件,如果用户的Default设置不是Outlook,就不行了).
 
不会吧?IE6内建这样的功能的,用IE6在一张图片上右键就有这一个功能了!(启动OutLook,对应图片为E-Mail的附件).
如果这样不行,哪有能不能用Delphi6实现呢?
 
这个功能不是用参数调用能够完成的,是接口调用。不过我一时不记得那个接口的名字了,
建议你搜索一下DFW,记得以前有人问过,也答过的。
 
下面是一个发MAIL的函数,可以加附件,是调用OUTLOOK,我测试过,可以用。
------------------------------------------------------------------------------
FUNCTION SendEMail(Handle : THandle; Mail : TStrings):Cardinal;
TYPE
TAttachAccessArray = ARRAY [0..0] OF TMapiFileDesc;
PAttachAccessArray = ^TAttachAccessArray;
VAR
MapiMessage : TMapiMessage;
Receip : TMapiRecipDesc;
Attachments : PAttachAccessArray;
AttachCount : INTEGER;
iCount : INTEGER;
FileName : STRING;
BEGIN
fillChar(MapiMessage, SizeOf(MapiMessage), #0);
Attachments := NIL;
fillChar(Receip,SizeOf(Receip), #0);
IF Mail.Values['to'] <> ''
THEN
BEGIN
Receip.ulReserved := 0;
Receip.ulRecipClass := MAPI_TO;
Receip.lpszName := StrNew(PChar(Mail.Values['to']));
Receip.lpszAddress := StrNew(PChar('SMTP:' + Mail.Values['to']));
Receip.ulEIDSize := 0;
MapiMessage.nRecipCount := 1;
MapiMessage.lpRecips := @Receip;
END;
AttachCount := 0;
FOR iCount := 0 TO MaxInt
DO
BEGIN
IF Mail.Values['attachment' + IntToStr(iCount)] = ''
THEN
BREAK;
AttachCount := AttachCount + 1;
END;
IF AttachCount > 0
THEN
BEGIN
GetMem(Attachments,SizeOf(TMapiFileDesc) * AttachCount);
FOR iCount := 0 TO (AttachCount - 1)
DO
BEGIN
FileName := Mail.Values['attachment' + IntToStr(iCount)];
Attachments[iCount].ulReserved := 0;
Attachments[iCount].flFlags := 0;
Attachments[iCount].nPosition := ULONG($FFFFFFFF);
Attachments[iCount].lpszPathName := StrNew(PChar(FileName));
Attachments[iCount].lpszFileName := StrNew(PChar(ExtractFileName(FileName)));
Attachments[iCount].lpFileType := NIL;
END;
MapiMessage.nFileCount := AttachCount;
MapiMessage.lpFiles := @Attachments^;
END;

IF Mail.Values['subject'] <> ''
THEN
MapiMessage.lpszSubject := StrNew(PChar(Mail.Values['subject']));
IF Mail.Values['body'] <> ''
THEN
MapiMessage.lpszNoteText := StrNew(PChar(Mail.Values['body']));

Result := MapiSendMail(0, Handle, MapiMessage,MAPI_DIALOG*Ord(Handle <> 0) OR MAPI_LOGON_UI OR MAPI_NEW_SESSION, 0);

FOR iCount := 0 TO (AttachCount - 1)
DO
BEGIN
strDispose(Attachments[iCount].lpszPathName);
strDispose(Attachments[iCount].lpszFileName);
END;

IF assigned(MapiMessage.lpszSubject)
THEN
strDispose(MapiMessage.lpszSubject);
IF assigned(MapiMessage.lpszNoteText)
THEN
strDispose(MapiMessage.lpszNoteText);
IF assigned(Receip.lpszAddress)
THEN
strDispose(Receip.lpszAddress);
IF assigned(Receip.lpszName)
THEN
strDispose(Receip.lpszName);
END;
 
to:iseek
give me demo,Ok?
 
ymqpc,你的Email?
 
iseek 老兄,也给我一个吧,
呵呵~~~~~~~
Netsofte_mail@163.com
 
Netsoft老兄,没你的份,捣什么乱,想看我出丑啊.呵呵.
 
sorry,my e-mail:ymq_sy@163.com,thanks.
 
多人接受答案了。
 
后退
顶部