Using an INI file with the e-mail and other data would make it much easier. Below is an example. It is not the most clean or advanced code but it is just a proof of concept.
Up until now I could not get the sender address set to anything else then the user that is running the script so I commented that line.

Sample INI file
 Quote:

[Docs]
names=Doc1#Doc2#Doc3

[Doc1]
email=doc1@@domain.com
[Doc2]
email=doc2@@domain.com
[Doc3]
email=doc3@@domain.com


Sample script:
 Code:
Break on

$docs = ReadProfileString("SomeINIFile.ini", "Docs", "Names")
$docs = Split($docs, "#")

For Each $doc in $docs
	$docemail = ReadProfileString("SomeINIFile.ini", $doc, "Email")
		
	$Root = CreateObject("Outlook.Application")
	$MailItem = $Root.CreateItem(0)
	$MailItem.Importance = 1
	; - 2 high importance
	; - 1 normal importance
	; - 0 low importance
	$MailItem.Subject = "Test"
	;$MailItem.Sender = "sender@@domain.com"
	$MailItem.To = $docemail
	$MailItem.Body = "Test body text"
	If Exist("C:\some folder\some file.txt")
		$MailItem.Attachments.Add("C:\some folder\some file.txt")
	EndIf
	$MailItem.Send
	$Root = 0
Next


Edited by Mart (2013-07-24 05:05 PM)
Edit Reason: Typo in the code. Thanks Shane.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.