in reply to sendmail code running extremely slow

That's the pretty standard way to send mail on a Unix system. There are lots of reasons why this could be slow; you probably want to ask the administrators of the system where your script is running why it's so slow, or look at the logs if you have them.

You could also try the option -oDeliveryMode=b, which asks sendmail to return immediately, even if the message isn't delivered yet.

You could also try sending the message by SMTP, which isn't any better, but may happen to be faster on this particular system.

  • Comment on Re: sendmail code running extremely slow

Replies are listed 'Best First'.
Re^2: sendmail code running extremely slow
by jd_jd (Initiate) on Jun 15, 2006 at 03:14 UTC
    Unfortunately, I am the admin of this server. I can run the mail command from the CLI and it gets sent in a split second. It's just the mail code within the perl script. I tried the -oDeliveryMode=b option, but it didn't seem to make it run faster.
      There should be no real difference between running from the command-line and from a Perl script. If you run your script from the command-line, does the message take a long time to send? What about if you try a second time? What if you switch to the Web server user before doing so? Do you do anything "weird" in your Web server setup, like chroot? What shows up in your Web server log? In your mail server log? Do you see the exact same effect if you run the small test script you included in your OP, both running from the command-line and the Web server?