可以用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
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
objMail.From = "[email protected]"
objMail.To = strEmail
objMail.Subject = strSubject
objMail.BodyFormat = 0
objMail.MailFormat = 0
objMail.Body = HTML
objMail.Send
Set objMail = Nothing
因为我个人的VB能力很一般(用VB才半个月,以前用VFP),所以用的方法很笨,但恰好符合我们工厂所需:能调用领导熟悉的outlook express,预加好附件,并停留在outlook express界面。
我先单独打开outlook express程序,在新邮件上加好所需附件!!!收件人、主题、内容可适当加上,然后“另存为”yourmail.eml文件,保存好后退出。
在VB中写上这样一句代码:
Shell "...\Outlook Express\msimn.exe /eml:\...\yourmail.eml"
注意,后缀名一定不能省。
那个yourmail.eml仿佛是一个电子邮件的模板,局域网上的其他用户调用它、进行修改并发送完成后并不会修改到源文件(也许执意覆盖能破坏,但我并不怕了!)
[email protected]
OICQ:2385624
你有没有试过我的解决方法,可以联络我。
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&
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>