you are often sending out more than just your message.
Many people see a lot of extra formatting stuff and other
junk that has nothing to do with your message.
It's annoying, uses extra bandwidth and not appropriate for eMail or news.
Certainly, sending out your messages as HTML without even a plain-text
alternative is just plain rude.
Blat is a small, efficent SMTP command line mailer for Windows. It is the
SMTP *sending* part of an eMail User Agent (MUA) or eMail client. As such,
Blat sends eMail via SMTP (or internet eMail) from the command line, or CGI, ...
Blat is NOT a drop in replacement for the Unix SENDMAIL, MAIL, MAILX
utilities (or for that matter, any other eMail tool you can think of).
A Perl script written to use these, for example, will not
work without some tweaking.
Most MS Exchange systems likely have an SMTP service, you should check with
your eMail administrator to find out what it is.
You do not want the \\domain\machine syntax here, but rather a
DNS syntax (smtp.MyDomain.com or whatever) or TCP/IP Address.
You should be able to ping to that name or address.
Because it simplifies the command line by storing any or all of the following
in the regestry [HKEY_LOCAL_MACHINE \ SOFTWARE \ Public Domain \ Blat].
SMTP Server Address
Sender's Address
Number of times to retry sending
Port number to use (ie, if not the SMTP default of 25)
The -q switch which "supresses *all* output"
Blat -install smtphost.bar.com [email protected] // Sets host and userid
Blat -install smtphost.bar.com foo // Sets host and userid
Blat -install smtphost.bar.com // Sets host only
One of the first things you want to do if you are having problems is use
the -debug switch (you can also use the ``-log logfile.log'' switch to put
the output in a file.)
<<<getline<<< 550 5.7.1 Unable to relay for [email protected]
A server will think it is 'relaying' when neither the sender or recipient
address are an address that belongs to it.
This is discussed more in RFC2821 (search for 'relay').
I am not sure why one would want to use Perl to call Blat. Perl can send
eMail nativly, so doesn't need Blat, and Blat has no need to be called by Perl.
However, I see the quest fairly often, so...
<Start Perl wrapper code>
#!perl -w
use strict;
# declare the variables we are going to use
my ($to, $f, $subject, $body, $server, $hostname, $u, $pw, $debug, $x, $return);
# you must change the values marked with <-- ****
# populate all the variables we are going to use
$to = "-to eMail\@MyDomain.com"; # <-- ****
$f = "-f eMail\@MyDomain.com"; # <-- ****
$subject = "-subject \"Testing blat\"";
$body = "-body \"Testing blat\"";
$server = "-server smtp.MyDomain.com"; # <-- ****
$hostname = "-hostname MyHost";
$u = "-u UserID"; # <-- ****
$pw = "-pw PW!"; # <-- ****
$debug = "-debug";
$x = "-x \"X-Custom-header: Check it out!\"";
# Here is where we run Blat.
# Note, the Perl vars are the same as Blat's paramaters.
# All the stuff you see Blat return to STDOUT (non error messages to
# the screen) get put in the $return variable.
$return = `blat - $to $f $subject $body $server $hostname $u $pw $debug $x`;
``NO real reason for calling it blat... actually I wanted to call it
Blat mainly because Pedro thought it was a ridiculous name.
And then because we could say things like 'I'm just going
to blat off a quick email to ...' etc...''