Solved

BLAT mail program setup

Posted on 2000-02-23
12
318 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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 50 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl efficient DB Call 8 87
Edit Odbc.ini using perl module 2 83
Perl File::Find alternative 1 69
Able to retrieve only 1 row through email amongst multiple rows 3 36
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

773 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