PHP mail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • glady
    New Member
    • Nov 2006
    • 23

    PHP mail

    Hi,
    I have a php mail program,
    <HTML>
    <BODY>
    <?php

    $to = "me@myhost.com" ;
    $from = "me@myhost.com" ;

    $subject = "Hi This is a test mail";
    $body = "Testing Email program and works";
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\n";
    $headers .= "From:$from \n";

    mail($to, $subject, $body, $headers);
    if (mail($to, $subject, $body, $headers))
    {
    echo("<p>Messag e successfully sent!to $to</p>");

    } else {
    echo("<p>Messag e delivery failed...Can't send email to $to</p>");
    }
    ?>
    </BODY>
    </HTML>
    The problem is i could not have any errors but i could not able to receive mail in my mailbox. I am working on PHP,MySQL,Apach e, and Linux.
    So have /etc/exim/exim.conf ---- (exim 3.36)
    /etc/php4/apache/php.ini
    how to configure?
    please help me.
    Thanks
    Glady.
  • vssp
    Contributor
    • Jul 2006
    • 268

    #2
    Go to php.ini file to enter the mail server and restart the server.

    Then only the mail send to another user\

    vssp

    Comment

    • ronverdonk
      Recognized Expert Specialist
      • Jul 2006
      • 4259

      #3
      Don't you have a blank character between From: and the from-address? If not, that is most likely your problem.

      Ronald :cool:

      Comment

      • glady
        New Member
        • Nov 2006
        • 23

        #4
        Originally posted by vssp
        Go to php.ini file to enter the mail server and restart the server.

        Then only the mail send to another user\

        vssp

        --------
        Hi how do i need to restart my mail server,

        actually in php.ini, i have this,
        [mail function]
        ; For Win32 only.
        ;SMTP = localhost
        ;smtp_port = 25

        ; For Win32 only.
        ;sendmail_from = myemail@mydomai n.com

        ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
        sendmail_path =
        please help!!!!! i was trying to make it work for many days.

        Comment

        • glady
          New Member
          • Nov 2006
          • 23

          #5
          Originally posted by ronverdonk
          Don't you have a blank character between From: and the from-address? If not, that is most likely your problem.

          Ronald :cool:
          I did by giving a blank character between From: $from
          but it dint work.
          please help!!!!!!

          Comment

          • glady
            New Member
            • Nov 2006
            • 23

            #6
            Originally posted by ronverdonk
            Don't you have a blank character between From: and the from-address? If not, that is most likely your problem.

            Ronald :cool:
            I would like to have a drop down box1, and it has 2 items in it.
            First when the form loaded, it should show that drop down box1 with 2 items in it.
            If i select item #2, in dropdown box1, another drop down box should appear. if i select item#1 in drp down box 1, another drop down box should disappear.
            How i can do it.
            <td align="right">< b>Fruit :</b></td>
            <td><select name="saletype" size="1" class="text" tabindex="9" onChange="showc ombobox(this.fo rm);">
            <option value="0" SELECTED>Apple</option>
            <option value="2">Orang e</option>
            </select>
            <SPAN name="Q1" id="Q1" STYLE="position :relative; visibility: hide;">
            <select name="sfruit" size="1" class="text" tabindex="10">
            <option value="0" SELECTED></option>
            <option value="1">grape fruit</option>
            <option value="2">lemon </option>
            <option value="3">lime</option>
            <option value="4">melon </option>
            </select>
            </SPAN>
            </td>
            function appear(obj) {
            obj.style.displ ay = "";
            }
            function showcombobox(fo rm){
            if(form.saletyp e.value=="2"){
            appear(Q1);
            }
            }
            could you help me the code, thanks.

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              The last question does not belong in this thread, this one was about PHP AND EMAIL! Open another one for this problem. And make sure to enclose your code with tags.

              If you don't know what I am talking about, then you omitted to read the Posting Guidelines, especially the part about showing code WITHIN code, html and php TAGS!!


              As for this problem, see thread http://www.thescripts.com/forum/thread560758.html

              Ronald :cool:

              Comment

              • ronverdonk
                Recognized Expert Specialist
                • Jul 2006
                • 4259

                #8
                Originally posted by glady
                --------
                Hi how do i need to restart my mail server,

                actually in php.ini, i have this,
                [mail function]
                ; For Win32 only.
                ;SMTP = localhost
                ;smtp_port = 25

                ; For Win32 only.
                ;sendmail_from = myemail@mydomai n.com

                ; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
                sendmail_path =
                please help!!!!! i was trying to make it work for many days.
                Are you running Windows or Unix for your email problem.

                Ronald :cool:

                Comment

                • glady
                  New Member
                  • Nov 2006
                  • 23

                  #9
                  Originally posted by ronverdonk
                  Are you running Windows or Unix for your email problem.

                  Ronald :cool:
                  I am running Linux, php , apache , mysql

                  Comment

                  • glady
                    New Member
                    • Nov 2006
                    • 23

                    #10
                    Originally posted by glady
                    I am running Linux, php , apache , mysql
                    /etc/exim/exim.conf
                    for email server
                    /etc/php4/apache/php.ini
                    for php conf

                    Comment

                    • ronverdonk
                      Recognized Expert Specialist
                      • Jul 2006
                      • 4259

                      #11
                      You are cross posting. DO NOT DO THAT, IT CONFUSES OUR MEMBERS AND ME!!

                      You had you answer about the same problem in another thread http://www.thescripts.com/forum/post2189812-8.html in this forum, so I will close this discussion for you.

                      Ronald :cool:

                      Comment

                      Working...