procedure TSuperEdit.SuperExportMailAsContent;
var
    email:string;
begin
    //email:='mailto:[email protected]?SUBJECT=Hello&attachment=\"c:\\www.txt\';
    email:='mailto:?subject='+extractfilename(filename)+'&body='+q_replacestr(lines.text,#13#10,'%0D%0A');
    ShellExecute(Handle,'open',pchar(email),nil,nil,SW_SHOW);
end;
我已经完成了邮件标题、地址、正文的填写,但如何完成附件的添加呢,我需要的只是调用出邮件程序的窗口并完成填写,不需要发送邮件。我看pspad就能够完成调用邮件程序并完成附件的添加,不知道它是如何完成。

解决方案 »

  1.   

    这个只能专用一种Mail客户端把,而且需要该客户端支持com接口之类的东西
      

  2.   

    Shellexecute doesn‘t accept Attachments.
    用控件吧
      

  3.   

    用控件因為要用到SMTP的帳戶這類的東西,請問有沒有控件可以直接用OUTLOOK的預設郵箱發送郵件?/
      

  4.   

    就没有其他方法了么?如果使用控件的话如何完成呢,我只要出现Outlook 发信的界面就可以了,不发送邮件。
      

  5.   

    每人会么?发消息能否完成,因为我发现好几个软件可以完成给Outlook Express添加附件的操作呀,期待大侠指点迷津呀。
      

  6.   

    如果仅针对outlook, 用createoleobject就行了uses comobj;function TForm1.SendMailWithAttachments(Email, Subject : string; Body : Widestring ; Filename : string): boolean;var  outlook : variant;  item : variant;begintry  outlook := CreateOLEObject('outlook.application');  try  item := outlook.CreateItem(0);  item.Subject := Subject;  // You can use "Body := Memo1.text".  item.Body := Body;  // You can add more Attachments by adding the same line.  item.Attachments.Add(FileName,1,1,FileName);  item.To := email;  item.Send;  finally  // To make sure Outlook don't stay open.  outlook.quit;  end;  except  result := false;  exit;  end;result := true;end;// Here is an example how the function works.procedure TForm1.Button1Click(Sender: TObject);var  Opendialog1 : TOpenDialog; begin  // Create an OpenDialog to get the Attachment.  // Is the Dialogs unit in the uses line?  Opendialog1 := TOpendialog.Create(application);  try  if OpenDialog1.Execute then  begin  SendMailWithAttachments('[email protected]', 'Delphi3000 function','Have fun!',opendialog1.FileName);  end;  finally  Opendialog1.Destroy;  end;end;