Hi,
I don't know if this is a sendmail or php issue so I will post this question in both forums.
I am trying to send an email from within php by calling 'Mail()' or sendmail, code is below:
$fd = popen("/usr/bin/sendmail -t","w"
;
fputs($fd, "To: $to\n"
;
fputs($fd, "From: $sender_name <$sender_email>\n"
;
fputs($fd, "Subject: $subject\n"
;
fputs($fd, "X-Mailer: PHP3\n"
;
fputs($fd, "$msg"
;
pclose($fd);
...or...
mail($to, $subject, $msg, $mailheaders);
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 Perl. Any help would be appreciated.
Thanks...
Rich.
I don't know if this is a sendmail or php issue so I will post this question in both forums.
I am trying to send an email from within php by calling 'Mail()' or sendmail, code is below:
$fd = popen("/usr/bin/sendmail -t","w"

fputs($fd, "To: $to\n"

fputs($fd, "From: $sender_name <$sender_email>\n"

fputs($fd, "Subject: $subject\n"

fputs($fd, "X-Mailer: PHP3\n"

fputs($fd, "$msg"

pclose($fd);
...or...
mail($to, $subject, $msg, $mailheaders);
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 Perl. Any help would be appreciated.
Thanks...
Rich.