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.Subject = strSubject
    oMessage.From = strSMTPFrom
    oMessage.To = strSMTPTo
    oMessage.TextBody = strTextBody
    oMessage.AddAttachment strAttachment


    Microsoft technet

    Sunday, February 18, 2018 9:11 AM