I had problems usig the blat utility to send mail with NT servers so I modified the file mailer.pm
as follows and it works very well. It may be useful for people with the same problem..
##########################################################
sub send_sendmail {
# ---------------------------------------------------------------
#Envía un mensaje usando Blat como sendmail.
my $self = shift;
my $to = $self->{'to'};
my $from = $self->{'from'};
my $msg = $self->{'msg'};
my $subject = $self->{'subject'};
my $tempfile = shift;
BEGIN{ srand $$.time }
do {$tempfile = int (rand (99999999)) . ".bla"} until !(-e $tempfile);
open(OUTPUT, ">E:\\yourpath\\$tempfile") ||
&error("Error al escribir en el fichero temporal $tempfile");
print OUTPUT $msg;
close OUTPUT;
system ("blat E:\\yourpath\\$tempfile -s \"$subject\" -f $from -t $to");
$self->log_msg() or return undef;
return 1;
}
#################################################################
You have to put in the links.cfg file the path to blat (e.g. $db_mail_path = 'C:\\Winnt\\System32\\blat.exe';)
and choose for sub send_mail the path where you want to put the temp files..e.g. E:\\yourpath\\
(you can also use $db_script_path) for the admin directory..)
but now I am trying to delete the temp files (*.bla) from my directory ...I do not need them anymore..
any idea or suggestion about how to do it?
Thanks
as follows and it works very well. It may be useful for people with the same problem..
##########################################################
sub send_sendmail {
# ---------------------------------------------------------------
#Envía un mensaje usando Blat como sendmail.
my $self = shift;
my $to = $self->{'to'};
my $from = $self->{'from'};
my $msg = $self->{'msg'};
my $subject = $self->{'subject'};
my $tempfile = shift;
BEGIN{ srand $$.time }
do {$tempfile = int (rand (99999999)) . ".bla"} until !(-e $tempfile);
open(OUTPUT, ">E:\\yourpath\\$tempfile") ||
&error("Error al escribir en el fichero temporal $tempfile");
print OUTPUT $msg;
close OUTPUT;
system ("blat E:\\yourpath\\$tempfile -s \"$subject\" -f $from -t $to");
$self->log_msg() or return undef;
return 1;
}
#################################################################
You have to put in the links.cfg file the path to blat (e.g. $db_mail_path = 'C:\\Winnt\\System32\\blat.exe';)
and choose for sub send_mail the path where you want to put the temp files..e.g. E:\\yourpath\\
(you can also use $db_script_path) for the admin directory..)
but now I am trying to delete the temp files (*.bla) from my directory ...I do not need them anymore..
any idea or suggestion about how to do it?
Thanks