Using /usr/bin/mail instead of sendmail?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ratlhead

    Using /usr/bin/mail instead of sendmail?

    Hi all,

    Because of a chroot jail a web site that I'm working on is in (I don't
    know much about the jail stuff), I can't use sendmail to send email
    through a PHP script. The sys admin said he's put a copy of the basic
    unix mail into the jail that I can use.

    Now I assume I can use this by just doing a shell_exec, but for some
    reason, I get no result out of it. If I run mail at command line
    (without the variable names), it works great.

    Can anyone suggest how I can approach this situation? Thanks!!

    $output = shell_exec("ech o $body | mail -s \"$subject\" $to");
    print ("$output");
  • Mike Blamires

    #2
    Re: Using /usr/bin/mail instead of sendmail?

    I would ask the admin (if this is possible) to adjust your PHP configuration
    and change the SMTP Server setting to specify mail rather than sendmail,
    this way you can address the mail server through the mail() command and
    transfer your code elsewhere with less worries.

    HTH
    Mike


    "ratlhead" <ratlhead@ratlh ead.com> wrote in message
    news:fd9c5ab3.0 307032033.1c460 5a1@posting.goo gle.com...[color=blue]
    > Hi all,
    >
    > Because of a chroot jail a web site that I'm working on is in (I don't
    > know much about the jail stuff), I can't use sendmail to send email
    > through a PHP script. The sys admin said he's put a copy of the basic
    > unix mail into the jail that I can use.
    >
    > Now I assume I can use this by just doing a shell_exec, but for some
    > reason, I get no result out of it. If I run mail at command line
    > (without the variable names), it works great.
    >
    > Can anyone suggest how I can approach this situation? Thanks!!
    >
    > $output = shell_exec("ech o $body | mail -s \"$subject\" $to");
    > print ("$output");[/color]


    Comment

    Working...