In this blog you will find ASP.NET 3.5 articles and some code samples. These code samples are created by me and should be working. Thanks for visiting my blog! Happy Dot Netting

Wednesday, July 2, 2008

Email user in VB script

Below mentioned module would show you how to email user in VB script.

Const strFrom = ""
Const strTo = ""
'Const strTo = ""

Const strSMTPServer = ""
Dim objMail
objMail = CreateObject("CDO.Message")
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer
objMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objMail.Configuration.Fields.Update()
objMail.From = strFrom
objMail.To = strTo

objMail.Subject = "Subject goes here...."
objMail.Textbody = " Text body goes here..."
objMail.Send()

objMail = Nothing

No comments: