[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 331
  • Last Modified:

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.
0
microboard
Asked:
microboard
  • 5
  • 4
  • 3
1 Solution
 
makerpCommented:
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.
0
 
microboardAuthor Commented:
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?
0
 
microboardAuthor Commented:
makerp, I've got to reject your answer so I can let others respond
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
clockwatcherCommented:
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. ;-)
0
 
makerpCommented:
sorry !!

clockwatcher is right but his syntax is wrong. its not an interactive install so it should work fine.

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

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

system($commandline);

its the system command which will execute the blat -install on the remote machine.

the \r\n is the equivelent of pressing return after a command is entered on the command line.

providing the blat exe is in the same dir as the script you are executing there should not be a prob with permissions ! you can execute a script so blat will be able to execute.

the output returned from the system command goes to the stdout so you will get it in your response.

you should get
'SMTP sever set' or somting like that

when you want to send a mail you will have to use the system command again but you will proably want to supress the output so it dont screew up your response. do this with the -q option, for testing though you can get the output in the response.    

0
 
clockwatcherCommented:
There's nothing wrong with my syntax.
0
 
microboardAuthor Commented:
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.
0
 
makerpCommented:
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
0
 
makerpCommented:
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 ??
0
 
clockwatcherCommented:
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.
0
 
microboardAuthor Commented:
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.
0
 
makerpCommented:
sorry clockwatcher, didnt note the backticks. ive only been doing perl for a little while.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now