Function mail() problem...

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

    Function mail() problem...

    Hello again.

    Mail() function in my php doesn't work.

    I've got very simple script:

    <?
    mail("bluszcz@j abberpl.org","T est","Test");
    ?>

    My php.ini important lines are:

    sendmail_path = /usr/sbin/poczta.sh
    log_errors = On
    error_log = /var/log/php.log
    error_reporting = E_ALL


    sendmail_path was earlier set to sendmail, but it doesn't work so i
    tried to debug it.

    error log works fine, but it doesn't show any error connected with mail
    function.

    /usr/sbin/poczta.sh is my script which contains:

    #!/bin/bash
    echo "mail() function was used" >>/tmp/php_MAIL.log


    Anyone has got an idea?

    Cheers,
    --
    Rafal Bluszcz Zawadzki
    JabberPL.org SysAdmin
    ----------------------
  • Alistair Baillie SS2002

    #2
    Re: Function mail() problem...

    does the script show an error?

    If not the mail function is working.

    Are you sure the address your sending it to, doesnt have spam filtering on,
    and hasn't caught the mail as spam?

    - Ali

    "Rafal Zawadzki" <bluszcz@jabber pl.org> wrote in message
    news:d6cm6m$1ls 2$1@node2.news. atman.pl...[color=blue]
    > Hello again.
    >
    > Mail() function in my php doesn't work.
    >
    > I've got very simple script:
    >
    > <?
    > mail("bluszcz@j abberpl.org","T est","Test");
    > ?>
    >
    > My php.ini important lines are:
    >
    > sendmail_path = /usr/sbin/poczta.sh
    > log_errors = On
    > error_log = /var/log/php.log
    > error_reporting = E_ALL
    >
    >
    > sendmail_path was earlier set to sendmail, but it doesn't work so i tried
    > to debug it.
    >
    > error log works fine, but it doesn't show any error connected with mail
    > function.
    >
    > /usr/sbin/poczta.sh is my script which contains:
    >
    > #!/bin/bash
    > echo "mail() function was used" >>/tmp/php_MAIL.log
    >
    >
    > Anyone has got an idea?
    >
    > Cheers,
    > --
    > Rafal Bluszcz Zawadzki
    > JabberPL.org SysAdmin
    > ----------------------[/color]


    Comment

    • Rafal Zawadzki

      #3
      Re: Function mail() problem...

      Alistair Baillie SS2002 napisa³(a):[color=blue]
      > does the script show an error?
      >
      > If not the mail function is working.[/color]

      This script doesn't create needed file.
      [color=blue]
      > Are you sure the address your sending it to, doesnt have spam filtering on,
      > and hasn't caught the mail as spam?[/color]

      YES.

      --
      Rafal Bluszcz Zawadzki
      JabberPL.org SysAdmin
      ----------------------

      Comment

      • Alistair Baillie SS2002

        #4
        Re: Function mail() problem...

        What do you mean, it doesnt create the required file?

        The one line of code you gave, doesnt tell it to create a file?


        "Rafal Zawadzki" <bluszcz@jabber pl.org> wrote in message
        news:d6co23$1n4 d$1@node2.news. atman.pl...[color=blue]
        > Alistair Baillie SS2002 napisa³(a):[color=green]
        >> does the script show an error?
        >>
        >> If not the mail function is working.[/color]
        >
        > This script doesn't create needed file.
        >[color=green]
        >> Are you sure the address your sending it to, doesnt have spam filtering
        >> on, and hasn't caught the mail as spam?[/color]
        >
        > YES.
        >
        > --
        > Rafal Bluszcz Zawadzki
        > JabberPL.org SysAdmin
        > ----------------------[/color]


        Comment

        • Alvaro G Vicario

          #5
          Re: Function mail() problem...

          *** Rafal Zawadzki wrote/escribió (Tue, 17 May 2005 14:01:32 +0200):[color=blue]
          > sendmail_path = /usr/sbin/poczta.sh[/color]
          [color=blue]
          > sendmail_path was earlier set to sendmail, but it doesn't work so i
          > tried to debug it.[/color]

          Does sendmail work from command line? Does PHP send mail if sendmail_path
          not set? Does the postmaster user get the message returned?
          [color=blue]
          > #!/bin/bash
          > echo "mail() function was used" >>/tmp/php_MAIL.log[/color]

          Does the script print the line? Does the script work from command line?
          Does apache user have permission to write on /tmp/php_MAIL.log?


          --
          -- Álvaro G. Vicario - Burgos, Spain
          -- http://bits.demogracia.com - Mi sitio sobre programación web
          -- Don't e-mail me your questions, post them to the group
          --

          Comment

          • Rafal Zawadzki

            #6
            Re: Function mail() problem...

            Alvaro G Vicario napisał(a):
            [color=blue]
            > Does sendmail work from command line? Does PHP send mail if sendmail_path
            > not set? Does the postmaster user get the message returned?[/color]

            Yes, No, No.
            [color=blue][color=green]
            >>#!/bin/bash
            >>echo "mail() function was used" >>/tmp/php_MAIL.log[/color]
            >
            >
            > Does the script print the line? Does the script work from command line?
            > Does apache user have permission to write on /tmp/php_MAIL.log?[/color]

            3*Yes.


            --
            Rafal Bluszcz Zawadzki
            JabberPL.org SysAdmin
            ----------------------

            Comment

            • Alvaro G Vicario

              #7
              Re: Function mail() problem...

              *** Rafal Zawadzki wrote/escribió (Wed, 18 May 2005 10:05:10 +0200):[color=blue][color=green]
              >> Does the script print the line? Does the script work from command line?
              >> Does apache user have permission to write on /tmp/php_MAIL.log?[/color]
              >
              > 3*Yes.[/color]

              I'd say that your sendmain clone doesn't not like the message then. Try the
              following:

              1) Check return value from mail() function
              2) Provide a valid "From" address


              --
              -- Álvaro G. Vicario - Burgos, Spain
              -- http://bits.demogracia.com - Mi sitio sobre programación web
              -- Don't e-mail me your questions, post them to the group
              --

              Comment

              • Rafal Zawadzki

                #8
                Re: Function mail() problem...

                Alvaro G Vicario napisał(a):[color=blue]
                > *** Rafal Zawadzki wrote/escribió (Wed, 18 May 2005 10:05:10 +0200):
                >[color=green][color=darkred]
                >>>Does the script print the line? Does the script work from command line?
                >>>Does apache user have permission to write on /tmp/php_MAIL.log?[/color]
                >>
                >>3*Yes.[/color]
                >
                >
                > I'd say that your sendmain clone doesn't not like the message then. Try the
                > following:
                >
                > 1) Check return value from mail() function
                > 2) Provide a valid "From" address[/color]

                Wait, script print the line ONLY from command line.


                --
                Rafal Bluszcz Zawadzki
                JabberPL.org SysAdmin
                ----------------------

                Comment

                Working...