Before Microsoft started thinking about security, this was easy. Now
every time you try to send an email, you get a warning that an external
program is accessing your address book or is trying to send mail.
Honestly, that's how viruses spread, and there is no difference between
your legitimate mail script and a virus as far as Outlook can
determine. So unless you disable Outlook's security or create a
separate script that will simulate a user by pressing the "OK" button
on all the security dialogs, you
won't get far.
Browser Form Email
Once again, security took most of the fun out of it. This used to be
"no programming" way to send email. HTML forms usually use the "get" or
"post" methods, but a few years ago browsers started supporting
"mailto" as an action. That meant everybody could use forms to collect
data, take orders, and act like the big dogs! Unfortunately, it also
meant every time you hit the "Submit" button on a form, you might be
disclosing your email address, IP address, and name to someone you'd
probably rather not have that information. As a result, browsers
now warn you when you submit a form that uses mailto for the
action. And modern script security stops scripts from automatically
a mailto form. However, when web pages are run from your hard drive,
most warnings are disabled. So this method is still good for some
things. Here's a couple of how-to pages:
2000 workstation has CDO, but it wants to use a locally-installed SMTP
server. Which only exists on servers, not workstations! However, you
can make it work with an outside smtp server:
Try this sample code
MAPI You may
hear about it, but it won't help you with scripts or batch files. MAPI
is a generic interface to the default mail client on a PC. However,
MAPI is accessed entirely through ordinary Windows DLL files which
scripts and batch files can't manipulate.
SMTP When There is No SMTP
If you use Lotus or Exchange or some other proprietary mail system,
your best bet is to try really, really hard to find an SMTP mail
server! Scan your internal network on port 25 (the smtp port). Or just
try telnetting to port 25 to web servers and other likely machines in
your intranet (use a command like
SMTP From the Command Line
You can send email from a simple batch file. I've used both the below
command-line emailers with no problems, but prefer BLAT:
SMTP via ActiveX Control Try these links for objects which scripting can manipulate to send email :
Some of the links may provide VB sample code, while others will provide ASP sample code. VBScript isn't that much different. My personal preference is JMail from Dimac (the first link). I've used an older SMTP-only version of their product for years with no problems.
Lost? Look at the site map.
Bad links? Questions? Send me mail.