Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Print array values in email body in vbscript

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Veeravicky22

Veeravicky22
  • Member
  • 1 posts
  • OS:none specified
  • Country: Country Flag
Hi ,

I have a list of values in an array. I want to print each value from the array in a new line in the email body. Please find below the code for the mail body. Please help me on how to display the each value in a new line in the mail body.
Set objFSO = CreateObject("Scripting.FileSystemObject") 

Dim objFSO, objFolder, colFiles
Set objFile = objFSO.OpenTextFile("C:\Deployment\Deploy_Group_Deploy\Input.txt", ForReading) 
 
Const ForReading = 1 
 
Dim arrFileLines() 
i = 0 
Do Until objFile.AtEndOfStream 
Redim Preserve arrFileLines(i) 
arrFileLines(i) = objFile.ReadLine 
i = i + 1 
Loop 
objFile.Close 

Set objEmail = CreateObject("CDO.Message")
ObjEmail.From = "xxxx@xxx.com"
objEmail.To = "xxxx@xxx.com"
objEmail.Subject = "Informatica Deployment Completion" 
Set objEmail.Textbody = 
<THIS IS WHERE I NEED TO PRINT THE ARRAY VALUES>
				
							
														
		    		
objEmail.Configuration.Fields.Item _ 
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ 
"xxxxx"
 
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
Gsm added code tags
Thanks,
Veera


How to remove advertisement from MSFN

#2
gunsmokingman

gunsmokingman

    MSFN Master

  • Super Moderator
  • 2,418 posts
  • OS:none specified
  • Country: Country Flag
Make these changes to your script and see if that works

Dim EmailTxt

 Do Until objFile.AtEndOfStream
  EmailTxt= EmailTxt & vbCrLf & objFile.ReadLine 
 Loop 
objFile.Close 


Set objEmail.Textbody = EmailTxt



GunSmokingMan






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN