Read from file and display in email body
- From: modemgeek <modemgeek@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Jun 2005 18:28:01 -0700
I would like this script to read from a text file and insert it into the body
of the email. This is what I have so far. Does anyone know how I can do
this?
'Set the global variables.
myName = "Tester"
mailFrom = "test1@xxxxxxxxx"
mailTo = "jtest@xxxxxxxx"
mailCC = "test@xxxxxxxx"
mailSubject = "Test"
HTMLBody ="<h1>Please review and reply to test2@xxxxxxxx with the
following:</h1><br>" & _
"1. Information in report has been reviewed and is accurate<br>" & _
"2. Information in report is not accurate and provide corrections<br><br>"
mailHost = "127.0.0.1"
Set objEmail = CreateObject("CDO.Message")
objEmail.From = myName & " <" & mailFrom & ">"
objEmail.To = mailTo
objEmail.CC = mailCC
objEmail.AddAttachment "c:\scripts\groupmembership2.txt"
objEmail.Subject = mailSubject
objEmail.HTMLBody = HTMLBody
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
MailHost
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
.
- Follow-Ups:
- Prev by Date: Re: Software Install script
- Next by Date: Re: Scheduled Task
- Previous by thread: Software Install script
- Next by thread: Re: Read from file and display in email body
- Index(es):
Relevant Pages
|