用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - vb代码库

API 发送邮件

2018-08-27 作者:layman666举报

[vb]代码库

Option Explicit

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

Sub SendMail()
On Error GoTo err
Dim MyMail As String
MyMail = "mailto:Chauncey.Wang@finisar.com?subject=Hello Chauncey&body=Good Morning........:%0A1:%0A2:%0A3:%0A" _
& Space(20) & "user: " + Environ("username") & "%0A" & Space(20) & "Date: " & Date

'%0A  换行 ;?subject 标题 ;&body 正文

ShellExecute 0&, vbNullString, MyMail, vbNullString, vbNullString, 1
End
err:
MsgBox "You don't have E-Mail App installed in the local PC!"

End Sub


分享到:
更多

网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。