?
Solved

BLAT mail program setup

Posted on 2000-02-23
12
Medium Priority
?
325 Views
Last Modified: 2010-05-18
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
Comment
Question by:microboard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 2550033
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
 

Author Comment

by:microboard
ID: 2551780
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
 

Author Comment

by:microboard
ID: 2552687
makerp, I've got to reject your answer so I can let others respond
0
Technology Partners: 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!

 
LVL 25

Expert Comment

by:clockwatcher
ID: 2553400
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
 
LVL 10

Accepted Solution

by:
makerp earned 200 total points
ID: 2553718
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
 
LVL 25

Expert Comment

by:clockwatcher
ID: 2556323
There's nothing wrong with my syntax.
0
 

Author Comment

by:microboard
ID: 2556354
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
 
LVL 10

Expert Comment

by:makerp
ID: 2557229
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
 
LVL 10

Expert Comment

by:makerp
ID: 2557246
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
 
LVL 25

Expert Comment

by:clockwatcher
ID: 2558610
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
 

Author Comment

by:microboard
ID: 2563686
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
 
LVL 10

Expert Comment

by:makerp
ID: 2564153
sorry clockwatcher, didnt note the backticks. ive only been doing perl for a little while.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question