none
Send file in body of email not as attachment vbscript RRS feed

  • Question

  • Hi,

    please find the below script is im using for attachment sending, but now i want to attach that attachment as body of the mail can u please suggest me how to do... 

    strSMTPFrom = "kampati.vinay@testing.in"
    strSMTPTo = "kampati.vinay@testing.in"
    strSMTPRelay = "testing"
    strTextBody = "MDaemon Q status"
    strSubject = "MDaemon Q status"
    strAttachment = "E:\output.txt"


    Set oMessage = CreateObject("CDO.Message")
    oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
    oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay
    oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
    oMessage.Configuration.Fields.Update

    oMessage.Subject = strSubject
    oMessage.From = strSMTPFrom
    oMessage.To = strSMTPTo
    oMessage.TextBody = strTextBody
    oMessage.AddAttachment strAttachment


    oMessage.Send



    Microsoft technet

    • Moved by Bill_Stewart Monday, April 30, 2018 9:29 PM Unanswerable drive-by question
    Monday, February 26, 2018 2:32 AM

All replies