sending a mail from Vb script

Discussion in 'JavaScript and AJAX' started by s_veena_85, Jun 17, 2008.

  1. s_veena_85

    s_veena_85 New Member

    Joined:
    Jun 17, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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?

    Code:

    Code:
    Dim objOutlook As Object
    Dim objOutlookMsg As Object
    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutlookMsg = objOutlook.CreateItem(0)
    With objOutlookMsg
       .To = "name@email.com"
       .Cc = "name@email.com"
       .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 a moderator: Jun 17, 2008
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,346
    Likes Received:
    382
    Trophy Points:
    83
    Moved to the right forum
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice