Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NT server - blat.exe

Status
Not open for further replies.

sparkiii

Programmer
Mar 16, 2003
2
AU
Hi all,
Firstly this is my first time to set this up so please be gentle with me.
I have set up an online order system using javascript, when I get to the checkout - on submit - it is directed to a .pl file in the cgi-bin (which has been set to the right permissions)I just adjusted a .pl file that the shopping cart script included. But the checkout just hangs after submit and comes up with a timeout error.
The server is an NT server and uses Blat.exe as the mail program.
The host has said this to me-

The problem seems to be with the way you are calling the mail program in your script.
The settings you have are correct ($mailprog & $mailserver) however you are not sending the required information to BLAT when you invoke Mail in your script.
Please note that BLAT requires command line switches spefying recipient address etc.
More information on the syntax can be found by searching for BLAT in the online help section of Mission Control.

This is what aserch on Blat at mission control told me-

Blat is the mail program installed on all web Server that can be used to send email from a cgi form.


The path to blat is e:\blat\blat.exe

syntax:
Blat <filename> -t <recipient> [optional switches (see below)]
Blat -install <server addr> <sender's addr> [-q]
Blat -h [-q]

-install <server addr> <sender's addr>: set's default SMTP server and sender

<filename> : file with the message body ('-' for console input, end with ^Z)
-t <recipient>: recipient list (comma separated)
-s <subj> : subject line
-f <sender> : overrides the default sender address (must be known to server)
-i <addr> : a 'From:' address, not necessarily known to the SMTP server.
-c <recipient>: carbon copy recipient list (comma separated)
-b <recipient>: blind carbon copy recipient list (comma separated)
-h : displays this help.
-mime : MIME Quoted-Printable Content-Transfer-Encoding.
-q : supresses *all* output.
-server <addr>: overrides the default SMTP server to be used.

Note that if the '-i' option is used, <sender> is included in 'Reply-to:'
and 'Sender:' fields in the header of the message.


But I dont know where to put this in the pl file or how to even start filling it out. I have tried but doesnt work for me. Am I asking for too much or does anyone else have any ideas for anything different I could use. I just want to be able to pass on the order and details by an email, (not just a big long text document)and for the person ordering to recieve an email as well.

Thanking you in advance

Nat

 
Can you post the bit of code that calls blat?

It should probably look something like:

[tt]my $cmd = sprintf( q{%s -q -f '%s' -t '%s' -s '%s'},
'E:\blat\blat.exe',
$from_address,
$to_address,
$subject );

open( MAIL, &quot;|$cmd&quot; ) or die &quot;$0: Can't open pipe to blat: $!&quot;;
print MAIL $msg or die &quot;$0: Can't print to blat: $!&quot;;
close MAIL or die &quot;$0: Can't close pipe to blat: $!&quot;;[/tt]


Cheers, &quot;As soon as we started programming, we found to our surprise that it wasn't as
easy to get programs right as we had thought. Debugging had to be discovered.
I can remember the exact instant when I realized that a large part of my life
from then on was going to be spent in finding mistakes in my own programs.&quot;
--Maurice Wilk
 
Hi,
Thanks so much for replying, is this the bit of code you are after,

$header = &quot;header.html&quot;;
$footer = &quot;footer.html&quot;;
$mailprogam = &quot;E:\\Blat\\Blat.exe&quot;;
$mailserver = &quot;smtp-au.server-mail.com&quot;;
$returnpage = &quot;/&quot;;
$youremail = &quot;nelmer\@adaptivecs.net.au&quot;;
$csvfilename = &quot;orders.csv&quot;;
$csvquote = &quot;\&quot;\&quot;&quot;;
$mode = &quot;EMAIL&quot;;

I have since found out this info as well.

UNIX perl scripts often use an external mail program called 'sendmail' for sending email. Windows 2000 servers use Blat for sending email. See the demonstration code below. If you obtain a UNIX based script that uses sendmail, replace all the email code in that script with the appropriate Blat code.

Thanks Nat

Thanks

Nat
 
Hi all, I've been working on my mail program using FormMail and the host provider is using Blat.exe which I cant get it work. I already tried many ways of changing the values on the $mailprogram and the @referrers on the FormMail but still I cant get it work to receive to my email. Here is the sample of the FormMail:

$mailprog = 'c:\winnt\system32\blat.exe -i -t';

@referers = ('domainame.com','IP Address','sub IP Address');

@recipients = ('^Mymail@mail.com');

Everything works smooth when I see the form coming out but not submitting to my email.

Does the Blat.exe talk to FormMail or I have to add something else.

Keep in mind that also I added the value on my HTML form.

Regards,
Tahira.
 
Sparkii,

sorry about delay, been away.

The code you posted doesn't actually run the mail program, it just names it. I suspect that it's got a typo in it so you need to check whether the mistake is in the code or just in your post. You posted

[tt]$header = &quot;header.html&quot;;
$footer = &quot;footer.html&quot;;
$mailprogam = &quot;E:\\Blat\\Blat.exe&quot;;
$mailserver = &quot;smtp-au.server-mail.com&quot;;
$returnpage = &quot;/&quot;;
$youremail = &quot;nelmer\@adaptivecs.net.au&quot;;
$csvfilename = &quot;orders.csv&quot;;
$csvquote = &quot;\&quot;\&quot;&quot;;
$mode = &quot;EMAIL&quot;;[/tt]

so you may just need to add the missing 'r' in program.

If you can also post the bit where $program is used, rather than defined, we could see if there is a problem there.

The quote you posted looks useful but you havn't posted the demonstration code to which it refers! Other ideas:

Make sure that your has permissions to execute the &quot;Blat&quot; executable, which includes having permissions to enter all directories leading to that executable.

Yours,


fish



&quot;As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.&quot;
--Maurice Wilkes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top