I have a wkix32 script that works great. It sends e-mails with different attachments for different doctors. I have a text file with the doctor name and e-mail addresses in it. I added a new doctor, but it will not e-mail the doctor. He is the only one with an internal e-mail address. I have tested with my e-mail (internal as well) and the same thing happens.

How can I add him with his internal exchange e-mail address? The following is a sample of the text file:
 Quote:

[Docs]
names=DOC1#DOC2
[DOC1]
e-mail=DOC1fnamelastname@shannonhealth.org
[DOC2]
email=DOC2fname.lastname@suddenlink.net


The script:
 Code:
$home = "\\server1\dir2\dir2"
;$FSO = createobject("Scripting.FileSystemObject"


$thismo = @monthno -1
IF $thismo = 0
  $month = "12"
ELSE
  IF $thismo > 9
    $month = CSTR($thismo)
  ELSE
    $month = "0" + CSTR($thismo)
  ENDIF
ENDIF
$year = IIf(@MONTHNO = 1, @YEAR -1, @YEAR)

;open log file
IF Open(2, "\\server2\dir1\dir2\log$month.txt",5) = 0
  $w = WriteLine( 2 , "docmailer2010.kix started at " +@DATE + " - " + @TIME + Chr(13) + Chr(10) )
  ELSE
  BEEP
  ? "Error opening log file: [" + @ERROR + "]"
  sleep 5
  EXIT
ENDIF


;main program loop

$rc = SetOption("NoMacrosInStrings","On")
$rc = SetOption("NoVarsInStrings","On")

$Docs = Split(ReadProfileString("\\server2\dir1\dir2\docmailer2010.txt","Docs","Names"),"#")
? "Elements in Docs Array: "+UBound($docs)

If UBound($docs)>=0
	$Root = CreateObject("Outlook.Application")
	$Session = $Root.GetNamespace("MAPI")
	$DefaultProfile = Outlook
	$Session.Logon($DefaultProfile)	
	$Folder = $Session.GetDefaultFolder(olFolderInbox)
	$Folder.Display
? "Outlook Creation: "+@Error
	For Each $Doc in $Docs
? "Doc: "+$Doc
		$docemail = ReadProfileString("\\server2\dir1\dir2\docmailer2010.txt", $doc, "Email")
? "Email: "+$docemail
		If Len($docemail)
			$MailItem = $Root.CreateItem(0)
? "Root Creation: "+@Error
			$MailItem.Importance = 1
			$MailItem.Subject = "Reports  -  !!! DO NOT REPLY !!!"
			$MailItem.Sender = "sender@company.org"
			$MailItem.To = $docemail
			$MailItem.Body = "!!! DO NOT REPLY - EMAIL IS NOT MONITORED.  FOR ASSISTANCE CALL 657-5041 !!!"
			$Attachments = DirList($home+"\"+$doc+"\(current month)",2)
? "Elements in Attachment Array: "+UBound($attachments)
			If UBound($Attachments)>=0
				For Each $Attachment in $Attachments
					$MailItem.Attachments.Add($Attachment)
? "Attachment: "+@Error
				Next
			Endif
			$MailItem.Send
? "Send: "+@Error
	Endif
	Next
	$Root = 0
Endif



I do have the DirList UDF at the bottom of the script.
This works great unless I am trying to send to an internal e-mail address. I am using the full e-mail address.