如何在Visual Basic 6.0中用API实现发送邮件到指定地址?
发布网友
发布时间:2022-05-01 12:51
我来回答
共3个回答
热心网友
时间:2023-10-13 10:08
Private Sub Command1_Click()
Dim objEmail As Object
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "发信邮箱"
objEmail.To = "目的邮箱"
objEmail.Subject = "vb邮件"
objEmail.Textbody = " 正文"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sensing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.163.com" '发信服务器 发信箱假设为163邮箱
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sensername") = " 发信邮箱账号名"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "发信邮箱密码"
objEmail.Configuration.Fields.Update
objEmail.Send
End Sub
热心网友
时间:2023-10-13 10:09
调用Jmail组件发送邮件
参考:http://hi.baidu.com/juncox/blog/item/8d8909ecc57f1ec6b31cb13a.html
调用CDO.Message发送邮件
参考:http://hi.baidu.com/juncox/blog/item/6cfadc3c65d44412baa1673d.html
希望对你有用!
热心网友
时间:2023-10-13 10:09
学习一下,```