There's a SendMailB() UDF on my web site that I recently extracted from the example here in the Script Vault forum. You can download that and follow the instructions and have a mail delivery system running in a few minutes.

Basically, you take your data and write it to a file, like this:
 Code:
$ = RedirectOutput('.\messageid.eml')
'This is the message body to send' @CRLF
'[SENDMAIL]' @CRLF
'RecipientAddr=' $SendTo @CRLF
'RecipientName=' $SendName @CRLF
'RecipientCC=' $CCList @CRLF
'RecipientBCC=' $BCCList @CRLF
'FromAddr=' $FromEmail @CRLF
'FromName=' $FromName @CRLF
'Subject=' $Subject @CRLF
'HtmlFormat=' 1 @CRLF
$ = RedirectOutput('')   ; close the message file
$aResult = SendMailB('.\messageid.eml')
This will send the message using Blat with the parameters in the MailSend.ini file, which is located in the script dir with Blat.exe.

The service-based version of this is actually quite handy, as it allows many systems to send an email without any special software or multiple authorizations defined. By having a single file server with the Blat executable and the mail sending service, all a script needs to do is create a file (as shown above) and then move it to the shared folder. Within 30 seconds, the file is found, processed, mail sent, and the file removed. This also improves (and simplifies) security by having just one system authorized for mail relay, yet any machine in the environment running with credentials authorized to the mail drop folder can send mail.

I use the code from the script vault almost as-is, except that I added a simple logging process that reports each message processed and the status from Blat. It's been so reliable that I never implemented the "retry" logic mentioned in the article, although that would not be difficult to do.

In my DMZ, the web content management server runs this script-service, and all of the web delivery servers use this to drop messages. The server sends the message to the hMail server (also in the DMZ), which is authorized for direct external delivery via smart-host, and allowed through the firewall to the Exchange server. The various maintenance and monitoring scripts that I use employ the same method. I defined a SRV record in DNS to identify the hosts with the mail drop folder, and the script gets the address/name of the server in their network using the GetResourceBySRV() UDF. (I have 2 mail-drop servers, one in the DMZ and one in the protected network. I create a SRV record for both and use the GetResourceBySRV() function to return the "closest" resource, based on network subnet range.)

I can convert the SendMailB() function to accept all parameters via an array, something that I had been planning to do. Give me an hour and I should have it ready and will post it here.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D