sending a mail from Vb script

s_veena_85's Avatar, Join Date: Jun 2008
Newbie Member
Hi All,

I am new this forum and for Vb script. I searched in this forum and i got a code to send mails using VB script.

But when i use the below code i get a pop message stating "this is auto mail sent , do you want to receive" .. How can i aviod this?


Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
   .To = ""
   .Cc = ""
   .Subject = "Hello World (one more time)..."
   .Body = "This is the body of message"
   .HTMLBody = "HTML version of message"
   .Attachments.Add ("f:\Test.txt")
   .Send 'Let´s go!
End With
Set objOutlookMsg = Nothing
Set objOutlook = Nothing

Thanks in advance.

Last edited by shabbir; 17Jun2008 at 18:27.. Reason: Code Block
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Moved to the right forum