Hi,
I don't know if this is a sendmail or code issue so I will post this question in both forums.
I am trying to send an email from within a perl scrip by calling sendmail, code is below:
$mailprog = '/usr/sbin/sendmail';
open(SENDMAIL, "|$mailprog -t "
print SENDMAIL "Reply-to: $sender_email\n";
print SENDMAIL "From: $sender_email\n";
print SENDMAIL "Subject: Test\n";
print SENDMAIL "To: me\@anywhere.com\n\n";
print SENDMAIL "$message\n";
close(SENDMAIL);
The problem is that this code takes about a minute to run. If I include this in a loop, then the code takes a minute for each iteration of the loop (ie. each sendmail call). I receive the item once the code has been processed, there is just a long delay to send the item. If I call sendmail from the command line then there is no delay, and I receive the item immediately. I also experience the same delay when calling sendmail from within PHP. Any help would be appreciated.
Thanks...
Rich.
I don't know if this is a sendmail or code issue so I will post this question in both forums.
I am trying to send an email from within a perl scrip by calling sendmail, code is below:
$mailprog = '/usr/sbin/sendmail';
open(SENDMAIL, "|$mailprog -t "
print SENDMAIL "Reply-to: $sender_email\n";
print SENDMAIL "From: $sender_email\n";
print SENDMAIL "Subject: Test\n";
print SENDMAIL "To: me\@anywhere.com\n\n";
print SENDMAIL "$message\n";
close(SENDMAIL);
The problem is that this code takes about a minute to run. If I include this in a loop, then the code takes a minute for each iteration of the loop (ie. each sendmail call). I receive the item once the code has been processed, there is just a long delay to send the item. If I call sendmail from the command line then there is no delay, and I receive the item immediately. I also experience the same delay when calling sendmail from within PHP. Any help would be appreciated.
Thanks...
Rich.