Re: how to output a file and send as email
- From: Trevor Sullivan <pcgeek86@xxxxxxxxx>
- Date: Wed, 18 Oct 2006 11:09:35 -0500
How wrote:
Hello,
I have a vb script that send out email with attached a file as below.
So right now i would like to output the file in the mail content rather then
attached a file.
Any precious advice?
Set objEmail = CreateObject("CDO.Message")
objEmail.From = " "
objEmail.To = " "
objEmail.Subject = "Test"
objEmail.Textbody = "Test"
objEmail.AddAttachment "c:\attachment"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"ip address"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
I am assuming that you're referring to a text file, which you'd like to
insert into the body of an e-mail? If so, you can use the
Scripting.FileSystemObject to read the text from the file and assign it
to the body of the e-mail message. See the OpenTextFile method in this link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/af4423b2-4ee8-41d6-a704-49926cd4d2e8.asp
Trevor Sullivan
MCP
.
- Follow-Ups:
- Prev by Date: Logon script not working when applied in AD
- Next by Date: Re: Whos is using printer driver.
- Previous by thread: Logon script not working when applied in AD
- Next by thread: Re: how to output a file and send as email
- Index(es):
Relevant Pages
|