Call to undefined function: mail()

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

    Call to undefined function: mail()

    Hello All!

    I'm a newbie to Linux and to PHP, so please be kind. I'm trying to
    tie into SendMail with some code and get the following error:

    Fatal error: Call to undefined function: mail() in
    /usr/local/apache/htdocs/development/test.php on line 317

    I installed SendMail after PHP. I was told that it could be my
    problem and I would have reinstall PHP. Does this sound right to
    anyone? Should I just be able to define the path to SendMail in a
    php.ini?

    Looking for guidance...hopi ng I won't have to reinstall PHP...the
    process is still a little scary for me.

    Thanks!
  • Savut

    #2
    Re: Call to undefined function: mail()

    You have to define sendmail_path in php.ini

    Savut

    "A. Name" <orakin@hotmail .com> wrote in message
    news:d1a2ec09.0 401210405.79e5d ed@posting.goog le.com...[color=blue]
    > Hello All!
    >
    > I'm a newbie to Linux and to PHP, so please be kind. I'm trying to
    > tie into SendMail with some code and get the following error:
    >
    > Fatal error: Call to undefined function: mail() in
    > /usr/local/apache/htdocs/development/test.php on line 317
    >
    > I installed SendMail after PHP. I was told that it could be my
    > problem and I would have reinstall PHP. Does this sound right to
    > anyone? Should I just be able to define the path to SendMail in a
    > php.ini?
    >
    > Looking for guidance...hopi ng I won't have to reinstall PHP...the
    > process is still a little scary for me.
    >
    > Thanks![/color]


    Comment

    • A. Name

      #3
      Re: Call to undefined function: mail()

      Savut,

      I have defined it. Still no dice...that's why I'm posting.

      "Savut" <webki@hotmail. com> wrote in message news:<bnxPb.163 03$cQ6.472790@n ews20.bellgloba l.com>...[color=blue]
      > You have to define sendmail_path in php.ini
      >
      > Savut
      >
      > "A. Name" <orakin@hotmail .com> wrote in message
      > news:d1a2ec09.0 401210405.79e5d ed@posting.goog le.com...[color=green]
      > > Hello All!
      > >
      > > I'm a newbie to Linux and to PHP, so please be kind. I'm trying to
      > > tie into SendMail with some code and get the following error:
      > >
      > > Fatal error: Call to undefined function: mail() in
      > > /usr/local/apache/htdocs/development/test.php on line 317
      > >
      > > I installed SendMail after PHP. I was told that it could be my
      > > problem and I would have reinstall PHP. Does this sound right to
      > > anyone? Should I just be able to define the path to SendMail in a
      > > php.ini?
      > >
      > > Looking for guidance...hopi ng I won't have to reinstall PHP...the
      > > process is still a little scary for me.
      > >
      > > Thanks![/color][/color]

      Comment

      • Jochen Daum

        #4
        Re: Call to undefined function: mail()

        On 21 Jan 2004 04:05:30 -0800, orakin@hotmail. com (A. Name) wrote:

        Maybe check disabled functions in php.ini and consult the config-line,
        if compiled in phpinfo()

        HTH, Jochen
        [color=blue]
        >Hello All!
        >
        >I'm a newbie to Linux and to PHP, so please be kind. I'm trying to
        >tie into SendMail with some code and get the following error:
        >
        >Fatal error: Call to undefined function: mail() in
        >/usr/local/apache/htdocs/development/test.php on line 317
        >
        >I installed SendMail after PHP. I was told that it could be my
        >problem and I would have reinstall PHP. Does this sound right to
        >anyone? Should I just be able to define the path to SendMail in a
        >php.ini?
        >
        >Looking for guidance...hopi ng I won't have to reinstall PHP...the
        >process is still a little scary for me.
        >
        >Thanks![/color]

        --
        Jochen Daum - CANS Ltd.
        PHP DB Edit Toolkit -- PHP scripts for building
        database editing interfaces.
        Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

        Comment

        • Manuel Lemos

          #5
          Re: Call to undefined function: mail()

          Hello,

          On 01/22/2004 12:13 AM, A. Name wrote:[color=blue]
          > I have defined it. Still no dice...that's why I'm posting.[/color]

          Usually this happens with RedHat installations of PHP compiled manually
          by a non-root user. What happens is that PHP configure does not find
          sendmail program in the PATH and disables the mail function. The
          solution is to rebuild PHP adding first to the PATH the directory where
          the sendmail executable can be found, usually /usr/lib/sendmail but that
          often that is a link to /usr/sbin/sendmail .

          --

          Regards,
          Manuel Lemos

          Free ready to use OOP components written in PHP
          Free PHP Classes and Objects 2025 Versions with PHP Example Scripts, PHP Tutorials, Download PHP Scripts, PHP articles, Remote PHP Jobs, Hire PHP Developers, PHP Book Reviews, PHP Language OOP Materials


          MetaL - XML based meta-programming language


          Comment

          • A. Name

            #6
            Re: Call to undefined function: mail()

            Manuel,

            Is it absolutely necessary to compile PHP to get SendMail configured
            to work with it? I did install SendMail after PHP, so the situation
            you describing is probably correct. What if I don't remember the cmd
            line code I used to compile PHP...the ./configure php-install --with
            aspx...obvious that's not it, but you should get the idea of what I
            mean. Will I have a problem?


            Manuel Lemos <mlemos@acm.org > wrote in message news:<bunh1a$jv kt7$1@ID-138275.news.uni-berlin.de>...[color=blue]
            > Hello,
            >
            > On 01/22/2004 12:13 AM, A. Name wrote:[color=green]
            > > I have defined it. Still no dice...that's why I'm posting.[/color]
            >
            > Usually this happens with RedHat installations of PHP compiled manually
            > by a non-root user. What happens is that PHP configure does not find
            > sendmail program in the PATH and disables the mail function. The
            > solution is to rebuild PHP adding first to the PATH the directory where
            > the sendmail executable can be found, usually /usr/lib/sendmail but that
            > often that is a link to /usr/sbin/sendmail .
            >
            > --
            >
            > Regards,
            > Manuel Lemos
            >
            > Free ready to use OOP components written in PHP
            > http://www.phpclasses.org/
            >
            > MetaL - XML based meta-programming language
            > http://www.meta-language.net/[/color]

            Comment

            Working...