Building a Mass-Emailer in WSH - Wrapping things up
(Page 4 of 4 )
Now that you have your base script, you should figure out other ways to implement it. You can use it as a network logon script or perhaps set it up as a scheduled task. Maybe you’re running a website on IIS and want to email daily logs to yourself. Whatever the case may be, your options are pretty much endless.
I would recommend adding to the script. As it is now, the script runs silently in the background. It would be nice to know when it completes or even to be able to monitor its progress. A simple Echo at the end of the subroutine would be better than nothing.
I would recommend incorporating full logging. Take a look at my article “Logging Events in WSH” to learn how to make your script maintain a text log file. Try listing each of the recipients as they are processed.
Unfortunately, error-handling with CDO is extremely complex. Short of knowing whether or not the CDO object was instantiated, there’s not much else you can do in script. You’ll have to rely on returned emails or your mail server logs to know whether or not the mail was successfully delivered.
Thanks for playing along again. I hope you were able to get something useful out of this. If you need any help customizing this to your needs, feel free to leave a message in the article blog. Have fun playing around with this script.
Oh, and please—no spamming. That’s it for me. Until next time, keep coding!
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |