Shell一个邮件程序并用你的地址做参数.
"C:\Program Files\Outlook Express\MSIMN.EXE mailto:[email protected]"

解决方案 »

  1.   

    在窗口里打开另一个窗口用show方法就行了
    例如你的程序第一个窗口是form1,另一个窗体是form2,要在第一个窗体中打开另一个窗体象下面这样就行了:
        form2.show
    一定要保证form2存在呀!
      

  2.   

    我复制了一份,这是以前提出的问题的答案。
    我记不住地址了。
    主  题:三问:mailto的语法、邮件附件???
    作  者:txyz
    所属论坛:Visual Basic
    问题点数:50
    回复次数:6
    发表时间:2000-12-19 13:44:00
     
    在VB中调出Outlook Express,且“必须”先加上邮件附件,最后停留在Outlook Express的程序界面上。
    我写的代码:
    Shell "...\Outlook Express\msimn.exe /mailurl:mailto:  ", vbNormalFocus我试过在mailto:后加上attachdocuments.add;
    也试过引用outlook97,但无法调出其程序界面,且出现错误提示“无传输程序”(因为WIN98中没有Exchange吧)
     
    回复贴子: 
    回复人:shines(2000-12-19 17:21:00)  得0分 
    可以用API,但是好像不能带附件。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
    Const SW_SHOWNORMAL = 1
    Private Sub Form_Load()
        'KPD-Team 1998
        'URL: http://www.allapi.net/
        'E-Mail: [email protected]
        'Send an E-Mail to the KPD-Team
        ShellExecute Me.hwnd, vbNullString, "mailto:[email protected]?subject=Iloveyou:-)....&body=Holle!Friends:-)MakeByGuozi", vbNullString, vbNullString, SW_SHOWNORMAL
    End Sub 
     
    回复人:zzj(2000-12-19 18:16:00)  得0分 
    用vb6自带的CDONTS.NewMail例子(以HTML格式发送邮件。前提:本机必须安装有Out Look,并能发送邮件),为何一定要用Out Look,以前我也一直希望用Out Look但现在不用了!Dim  objMail as New CDONTS.NewMail
    objMail.From = "[email protected]"
    objMail.To = strEmail
    objMail.Subject = strSubject
    objMail.BodyFormat = 0
    objMail.MailFormat = 0
    objMail.Body = HTML
    objMail.Send
    Set objMail = Nothing
     
     
    回复人:txyz(2000-12-20 14:47:00)  得0分 
    这个问题已经由我自己完全解决了。
    因为我个人的VB能力很一般(用VB才半个月,以前用VFP),所以用的方法很笨,但恰好符合我们工厂所需:能调用领导熟悉的outlook express,预加好附件,并停留在outlook express界面。
    我先单独打开outlook express程序,在新邮件上加好所需附件!!!收件人、主题、内容可适当加上,然后“另存为”yourmail.eml文件,保存好后退出。
    在VB中写上这样一句代码:
    Shell "...\Outlook Express\msimn.exe /eml:\...\yourmail.eml"
    注意,后缀名一定不能省。
    那个yourmail.eml仿佛是一个电子邮件的模板,局域网上的其他用户调用它、进行修改并发送完成后并不会修改到源文件(也许执意覆盖能破坏,但我并不怕了!)
     
     
    回复人:monkey79(2000-12-23 21:17:00)  得0分 
    关注(E-mail to me )
    [email protected]
    OICQ:2385624 
     
    回复人:txyz(2000-12-25 17:11:00)  得0分 
    to monkey79:
    你有没有试过我的解决方法,可以联络我。 
     
    回复人:Alpha(2000-12-25 17:22:00)  得0分 
    Mailto Protocol--------------------------------------------------------------------------------Opens a client's e-mail system.Syntaxmailto:sAddress[sHeaders]Possible ValuessAddress Required. One or more valid e-mail addresses separated by a semicolon. You must use Internet-safe characters. Use %20 for the space character. 
    sHeaders Optional. One or more name-value pairs. The first pair should be prefixed by a "?" and any additional pairs should be prefixed by a "&". The name can be one of the following strings. String Description 
    subject Optional. Text to appear in the subject line of the message. 
    body Optional. Text to appear in the body of the message.  
    CC Optional. Addresses to be included in the "cc" (carbon copy) section of the message. 
    BCC Optional. Addresses to be included in the "bcc" (blind carbon copy) section of the message. 
    ResThis is available as of Microsoft® Internet Explorer 3.0 or later. For more information on the mailto protocol, see RFC 2368.
    ExampleThe following example shows a mailto URL that will prepare an e-mail message when typed into the Internet Explorer address bar.mailto:[email protected]?subject=Feedback&body=The InetSDK Site Is Superlative"The following example shows a link that will prepare an e-mail message.<A HREF="mailto:[email protected]?
        subject=Feedback&amp;
        body=The%20InetSDK%20Site%20Is%20Superlative">
        Click here to send feedback to the InetSDK.</A>The following example shows how to use an HTML form to create an e-mail message.<FORM ACTION="mailto:[email protected]" METHOD=GET>
    <INPUT NAME=subject TYPE=hidden VALUE="InetSDK%20User%20Feedback">
    Enter comments about this site:<BR>
    <TEXTAREA NAME=body COLS=40>
    InetSDK: http://msdn.microsoft.com/workshop/
    The InetSDK site is superlative!
    </TEXTAREA>
    <INPUT TYPE=submit VALUE="Send Feedback">
    </FORM>
     
      

  3.   

    哦,地址是:
    http://www.csdn.net/expert/TopicView.asp?id=49998