Link to home
Start Free TrialLog in
Avatar of microboard
microboard

asked on

BLAT mail program setup

Can someone tell me how to install BLAT correctly on my server? In the instructions it says to run BLAT with the "-install" parameter, but how do I do this on a remote server? I am using Windows NT. I have simply uploaded the BLAT execute and attempted to email a message with it. The results indicate that all went well and that the message was sent, but I never receive an email, so I know I must not have set it up correctly. Hope someone understands the trouble I'm having.
Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

blat uses a mail server, it doesnt actually do the emailing.

blat -install <mail.server.address> <your@email.address>

will install blat on your machine.

then test it with the following

blat temp.txt -t your@mail.address -s "test mail"

where test.txt is a file that will make up the body of the mail

the -q option will suppress output but leave this off while you testing. your need it on if its in a cgi etc because otherwise it will mess your html output up.
Avatar of microboard
microboard

ASKER

makerp, you have skipped over the very point I was asking: How do I use the INSTALL parameter on a remote server? If it were on my computer it would be easy but how do I send a command line to run the install option when the only way I can use the file is through FTP? So, how do I send this line:
blat -install <mail.server.address> <your@email.address>

to the server?
makerp, I've got to reject your answer so I can let others respond
The 'correct' way to install it would be to call up the people who are managing your server and have them install it for you.

One 'incorrect' and possibly hazardous way would be to try installing it via CGI.  If it's not an interactive install then you might be able to get away with the following script:

  $mailserver = "10.0.0.1";
  $emailaddress = "a\@b.com";

  print "Content-Type: text/html\n\n";
  $results = `blat -install $mailserver $emailaddress`;
  print $results;

Whether it will work or not will depend upon what kind of priveleges they've left the anonymous webserver account.  It could end up screwing up their machine-- probably nothing serious, but depending upon what the install does it might not be the best idea. ;-)
ASKER CERTIFIED SOLUTION
Avatar of Paul Maker
Paul Maker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
There's nothing wrong with my syntax.
Thanks makerp I know what you given will work however everytime I try it, I either get this response : "CGI ERROR: DID NOT RETURN THE PROPER HEADERS  - to set the SMTP server's address and the user name at that address do:
blat -install server username" or I get a download box as if the file is trying to be put on my computer.

Would you mind showing me how to implement the code so that it does not get the CGI error or attempt to download itself.
okay, first off clockwatchers syntax will just display the the line blat -install blah blah..... not actually execute the command on the remote server !!.

to use the script i have written put a file called test.txt in the dir and put some test text in it. also the variable $testmail needs to contain your mail address.... or the senders address $mailaddress if its the same...  

code :

print("Content-Type: text/html\n\n");
print("<HTML><HEAD>Blat installation script..</HEAD><BODY><H1>Attempting to install blat</H1>");

$mailserer = "<mail.server.com>";
$mailaddress = "<your@mail.address>";

$commandline = "blat -install ".$mailserver." ".$emailaddress." \n\r";

print("The system command ".$commandline." produced the following out put<BR>");

system($commandline);

print(<HR>"I will now try to send a mail to you .......<BR><BR>");

$testmail = "<your@mail.address>";

$commandline = "blat test.txt -t ".$testmail." -s \"A test mail with blat\" \n\r";

print("blat produced the following output using commandline ".$commandline."  ....<BR>");

system($commandline);

print("<BR>hopefully you got something like<BR>sending test.txt to ".$testmail."<BR>subject:A test mail with blat<BR>login name is ".$mailaddress."</BODY></HTML>");

end of code

if it dont work for any reason check the variable names and that ive put a $ in front of em all, im used to C programming!!

do i get some points now ?

cheers
oh .. also

ive left the -q option off of the test mail bit. -q suppresses output. ive done this so you can check its working. you will probably want to have this on for real as otherwise your output will get stuffed up !!

if you dont get a mail do a script with just the test mail bit in, its being a bit ambitious to expect the server to set you up so quickly ??
makerp,

My code will do no such thing.  Those are backticks, not normal quotes.  $results will contain the result of executing the blat command.  I think you need to brush up on your perl syntax.
makerp, after a bit of trial and error and resettling some parts of your code, it worked fine. You get the points, however, if not for clockwatcher's backticks I wouldnt have been able to figure out the problem I was still having. I don't know how to separate points or I would gladly give both of you the points.

Thanks again.
sorry clockwatcher, didnt note the backticks. ive only been doing perl for a little while.