Sendmail PHP integration problem

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

    Sendmail PHP integration problem

    Hi all,
    I am using a simple php script to send a mail.

    <?php
    if (mail($to, $sub, $message, $from))
    echo "sent mail successfully<br >\n";
    ?>

    It GOES $to = "me@localhost.l ocaldomain"

    But NOT $to = "someone@some.o ther.domain"

    I use following configuration in php.ini
    sendmail_path = "sendmail -v -t -i"

    so I see "successful ly delevery acceptance" in both case at verbose
    messages.

    However I CAN SEND messages to BOTH address successfully USING
    telnet localhost 25

    So what I feel is sendmail configuration works properly. But there is
    a problem in interfacing sendmail and php.

    Please help me to solve it out.

    Thanks in advance - SB
  • CountScubula

    #2
    Re: Sendmail PHP integration problem

    can you post a bit more of your code?

    --
    Mike Bradley
    http://www.gzentools.com -- free online php tools
    "Sumith Bandula" <sumith@cse.mrt .ac.lk> wrote in message
    news:7aeb985.04 01282253.21c4fa c0@posting.goog le.com...[color=blue]
    > Hi all,
    > I am using a simple php script to send a mail.
    >
    > <?php
    > if (mail($to, $sub, $message, $from))
    > echo "sent mail successfully<br >\n";
    > ?>
    >
    > It GOES $to = "me@localhost.l ocaldomain"
    >
    > But NOT $to = "someone@some.o ther.domain"
    >
    > I use following configuration in php.ini
    > sendmail_path = "sendmail -v -t -i"
    >
    > so I see "successful ly delevery acceptance" in both case at verbose
    > messages.
    >
    > However I CAN SEND messages to BOTH address successfully USING
    > telnet localhost 25
    >
    > So what I feel is sendmail configuration works properly. But there is
    > a problem in interfacing sendmail and php.
    >
    > Please help me to solve it out.
    >
    > Thanks in advance - SB[/color]


    Comment

    • Sumith Bandula

      #3
      Re: Sendmail PHP integration problem

      Mike Bradley wrote:[color=blue]
      > can you post a bit more of your code?[/color]

      In my real program I use bit complex set of codes. However after
      realizing the problem I tested it with the given few lines of code. So
      I don't have any more codes for this, but here is my real lines of
      code.

      <?php
      if (mail("sumith@l ocalhost.locald omain", "test", "test", "From:
      sumith@localhos t.localdomain"))
      echo "Email 1 sent<br>\n";

      if (mail("sumith@c se.mrt.ac.lk", "test", "test", "From:
      sumith@cse.mrt. ac.lk"))
      echo "Email 2 sent<br>\n";
      ?>

      I get both "Email 1 sent" and "Email 2 sent" messages, but second mail
      doesn't delever.

      Anyhow I can send a mail to second address by TELNETing port 25.

      Thanks a lot for your concern - SB

      Comment

      • onu Ramp

        #4
        Re: Sendmail PHP integration problem

        "Sumith Bandula" <sumith@cse.mrt .ac.lk> wrote in message
        news:7aeb985.04 01282253.21c4fa c0@posting.goog le.com...[color=blue]
        > It GOES $to = "me@localhost.l ocaldomain"[/color]


        What about php.ini and variable "sendmail_from" ?

        uncle Ramp


        Comment

        • laidbak

          #5
          Re: Sendmail PHP integration problem

          You need to check your PHP.ini and make sure the
          sendmail from variable is set to a valid address.
          _______________ _______________ ______
          Wil Moore III, MCP | Integrations Specialist | Senior Consultant
          DigitallySmooth Inc. | Quick Site Studio
          "Sumith Bandula" <sumith@cse.mrt .ac.lk> wrote in message news:7aeb985.04 01282253.21c4fa c0@posting.goog le.com...
          Hi all,
          I am using a simple php script to send a mail.

          <?php
          if (mail($to, $sub, $message, $from))
          echo "sent mail successfully<br >\n";
          ?>

          It GOES $to = "me@localhost.l ocaldomain"

          But NOT $to = "someone@some.o ther.domain"

          I use following configuration in php.ini
          sendmail_path = "sendmail -v -t -i"

          so I see "successful ly delevery acceptance" in both case at verbose
          messages.

          However I CAN SEND messages to BOTH address successfully USING
          telnet localhost 25

          So what I feel is sendmail configuration works properly. But there is
          a problem in interfacing sendmail and php.

          Please help me to solve it out.

          Thanks in advance - SB

          Comment

          • Sumith Bandula

            #6
            Re: Sendmail PHP integration problem

            "onu Ramp" <imeloom%20hot. ee> wrote in message news:<4019ecf3$ 0$172$bb624dac@ diablo.uninet.e e>...[color=blue]
            >
            > What about php.ini and variable "sendmail_from" ?
            >[/color]
            As I know "sendmail_f rom" and "SMTP" are useful only in Windows.

            I just commented it since I am using Linux.

            Anyhow I tried with few options of these values as well. But couldn't succeed - SB

            Comment

            • Sumith Bandula

              #7
              Solved =&gt; Re: Sendmail PHP integration problem

              sumith@cse.mrt. ac.lk (Sumith Bandula) wrote in message news:<7aeb985.0 401282253.21c4f ac0@posting.goo gle.com>...[color=blue]
              > <?php
              > if (mail($to, $sub, $message, $from))
              > echo "sent mail successfully<br >\n";
              > ?>
              > It GOES $to = "me@localhost.l ocaldomain"
              > But NOT $to = "someone@some.o ther.domain">
              > Please help me to solve it out.
              >[/color]

              Finally I could solve it out. Thanks for all of you concern the
              problem. Here is the simple change I did for the benifit of others who
              might come across same type of problem.

              Just add following line to the end of sendmail.mc file mostly
              locateted in /etc/mail/

              Cwmachinename.y our.domain.name

              Note that 'Cw' at the begining of above line.
              Then run:

              make -C /etc/mail

              to reconfigure sendmail.cf. This might differ in different versions.

              Finally thanks to all of you again - SB

              Comment

              Working...