命令又是怎么写的?

解决方案 »

  1.   

    这有一个VB的例子:
    先声明API函数ShellExecute:
    Private Declare Function ShellExecute Lib "shell32.dll" _
        Alias "ShellExecuteA" (ByVal hWnd As Long, _
        ByVal lpOperation As String, ByVal lpFile As String, _
        ByVal lpParameters As String, ByVal lpDirectory _
        As String, ByVal nShowCmd As Long) As Long
    Private Const SW_SHOWNORMAL = 1再看一下MailTo的语法:MailTo:Address[&CC=抄送人列表][&BCC=暗送人列表][&Subject=标题][&Body=邮件正文][&Attach=用引号包含的附件文件名]好了,就这么简单,你的VB程序只要生成这样一个字符串传给ShellExecute就行了。创建一个新VB工程,窗体上加入6个 textbox和一个按钮(cmdSendIt),把上面的声明和下面的代码Paste过去:Private Sub cmdSendIt_Click()Dim sText As StringDim sAddedText As StringIf Len(txtMainAddresses) Then   sText = txtMainAddressesEnd IfIf Len(txtCC) Then   sAddedText = sAddedText & "&CC=" & txtCCEnd IfIf Len(txtBCC) Then   sAddedText = sAddedText & "&BCC=" & txtBCCEnd IfIf Len(txtSubject) Then   sAddedText = sAddedText & "&Subject=" & txtSubjectEnd IfIf Len(txtBody) Then   sAddedText = sAddedText & "&Body=" & txtBodyEnd IfIf Len(txtAttachmentFileLocation) Then   sAddedText = sAddedText & "&Attach=" & _      Chr(34) & txtAttachmentFileLocation & Chr(34)End IfsText = "mailto:" & sText' clean the added elementsIf Len(sAddedText) <> 0 Then' there are added elements, replace the first' ampersand with the question character   Mid$(sAddedText, 1, 1) = "?"End IfsText = sText & sAddedTextIf Len(sText) Then   Call ShellExecute(Me.hWnd, "open", sText, _
          vbNullString, vbNullString, SW_SHOWNORMAL)End IfEnd Sub说明:有的邮件程序可能不支持所有的参数。
      

  2.   

    to wpg():请教一个问题:"邮件正文"里面可以回车换行吗?怎么表示?谢谢!
      

  3.   

    为什么在Delphi中,attach参数用不了啊?
      

  4.   

    office 自己带的 outlook 可以实现,但是如果用系统IE 的Outlook 5.0 hu或 OutLook 6.0 好像不行,我以前也做过类似的东西。
      

  5.   

    哈哈,问到我了,不过分要给我 :-)第一:OutLook支持添加附件,OutLook Express不支持第二:你试试 '我要换&0d&0a行';