如何发送电子邮件到通讯组列表使用VBScript在ASP [英] How to send email to a distribution list with vbScript in an asp
本文介绍了如何发送电子邮件到通讯组列表使用VBScript在ASP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我很新为VBScript但这里是我到目前为止,似乎并没有被工作虽:
I'm very new to vbscript but here's what I have so far, Doesn't seem to be working though:
<script type="text/vbscript">
Sub Senmail()
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = "eric@gmail.com"
.Cc = "name@email.com"
.Subject = "Hello World (one more time)..."
.Body = "This is the body of message"
.HTMLBody = "HTML version of message"
.Send
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
</script>
任何投入将是AP preciated!或任何其他方式,我可以发送电子邮件是我的ASP ....
Any input would be appreciated! Or any other ways I could send an email is my asp....
推荐答案
下面是一个使用CDO / SMTP单程
Here's one way using CDO / SMTP
Sub SendMail()
Set objMsg = CreateObject("CDO.Message")
Set objConfig = CreateObject("CDO.Configuration")
Set objFields = objConfig.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YourSMTPServer"
.Update
End With
With objMsg
Set.Configuration = objConfig
.To = "eric@gmail.com"
.CC = "name@gmail.com"
.From = "you@gmail.com"
.Subject = "Hello World"
.HTMLBody = "This is the body of message"
.Fields.Update
.Send
End with
Set objMsg = Nothing
Set objConfig = Nothing
End Sub
这篇关于如何发送电子邮件到通讯组列表使用VBScript在ASP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文