Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Mar 2004
    Posts
    9

    Unanswered: mail() doesn't work completely

    Hi everybody,

    I installed today PHPTriad, a program which installs Apache, PHP and Mysql...after configuring everything one of the scripts is not working fine.

    the mail(function) with the $headers doesn't work...it doesn't send neither to the recipient or to the copy addresses.

    As soon as I take out the $headers, the script is working and the recipient gets a message.

    Can somebody tell me what the problem can be or what I can do?

    Greetings

    Moreli2

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: mail() doesn't work completely

    Originally posted by moreli2
    Hi everybody,

    I installed today PHPTriad, a program which installs Apache, PHP and Mysql...after configuring everything one of the scripts is not working fine.

    the mail(function) with the $headers doesn't work...it doesn't send neither to the recipient or to the copy addresses.

    As soon as I take out the $headers, the script is working and the recipient gets a message.

    Can somebody tell me what the problem can be or what I can do?

    Greetings

    Moreli2
    OS - ? (probably Windows)
    Post code here.

  3. #3
    Join Date
    Mar 2004
    Posts
    9
    Yes,

    Windows ME

  4. #4
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    if you read the PHPGeek Help in the control panel it says

    "Windows doesn't have a mail server by default. Scripts that use mail() will not work unless you have a mail server at your disposal. I recommend Hermes. "
    Mr. Lars

  5. #5
    Join Date
    Mar 2004
    Posts
    9
    Yes, I have read it...

    But in the meantime I uninstalled PHPTriad and installed everything seperate again...apache 2.0.48, PHP 4.3.4 and Mysql.

    Now my script shows another problem

    After the line

    if(isset($nickname) && isset($emailaddress))

    which is true and correct spelled, the script goes automatically to the line

    else echo "Please fill in your nickname and/or emailaddress!";

    I am 99 percent sure it has nothing to do with the script, because 2 days ago this was working fine...but after reinstalling apache and php, I think I see something over the head with the configuration.

    Please who had this same problem or who can give me the solution that it works again.

    Greetings

    Moreli2

  6. #6
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    somehow its not recieving BOTH of those variables. Try to find where the variables are coming from and see if there is a problem there. Thats all I can think of.
    Mr. Lars

  7. #7
    Join Date
    Mar 2004
    Posts
    9
    There is nothing wrong from the form it comes from...both variabele are written the same and like I wrote before, 3 days ago the script was working perfectly....

    I don't know anymore or I am just blind.

  8. #8
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    my guess is your just blind . Why dont you post the script so I can take a better look.
    Mr. Lars

  9. #9
    Join Date
    Mar 2004
    Posts
    9
    here is just a small part, the rest isn't important

    html page:

    <form method="GET" action="mailform.php">
    <input name="nickname"><br>
    <input name="emailadres"><br>


    mailform.php:

    <?php

    if (isset($nickname) && isset($emailadres))

    {$message = "Beste,\nUw login is $nickname.\n\nGroeten,\nMarcel";

    $headers = 'From: address1@domain.com\r\n';
    $headers .= 'Cc: address2@domain.com, address3@domain.com\r\n';

    if (!mail($emailadres,"Welkom op pizza-service.biz",$message,$headers))

    {echo "We kunnen geen mail sturen naar je opgegeven mailadres. Ben je zeker dat het correct is?";}

    else {echo "Uw gegevens werden goed verwerkt, en je paswoord werd opgestuurd naar je mailadres.";
    echo "<br><br>";
    echo "Bedankt om voor pizza-service.biz te kiezen...";}

    }

    else echo "Please fill in your nickname and/or emailaddress!";

    ?>

    Some of the line are written in Dutch, but that is not so important... It's more that I don't see a mistake.

  10. #10
    Join Date
    Mar 2004
    Posts
    6

    Mail function not working under windows

    Hi,

    I too have a similar problem. I have a windows 2000 server with php apache and mysql installed on it. I have updated php.ini as follows.

    [mail function]
    SMTP=192.168.1.241 ;for win32 only
    sendmail_from=hitendra.molleti@itp.net ;for win32 only
    ;sendmail_path = ;for unix only, may supply arguments as well (default is sendmail -t)



    But then too the mail function doesnt seem to work. Neither do i get an error. I am totally blank as to what happens. The page doesnt give an error and simply submits the variables to the mail function and is fine.

    And i never receive the mail. Can you please suggest what is the problem.

    Our mail server runs mailer daemon which is a software to manage incoming and outgoing mails and is also our SMTP on the intranet. Our outlooks use the same ip and smtp server. So, why doesnt it work for php?

    Please advise.

    Thanks and regards

    Hitendra

  11. #11
    Join Date
    Mar 2004
    Posts
    9
    I believe I think what the problem is...

    the problem is that the script is not receiving the $nickname and the $emailadres from the html page...Why is this coming?

    As soon as I put those to variable in the top of the script, the script is normally working.

    Can somebody explain this to me?

    Greetings

    Moreli2

  12. #12
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61
    try method="post"
    Mr. Lars

  13. #13
    Join Date
    Mar 2004
    Posts
    9
    I did...

    doesn't work

  14. #14
    Join Date
    Jun 2003
    Location
    Minnesota
    Posts
    61

    Wink

    well i spose it would be helpful to have a submit button
    Mr. Lars

  15. #15
    Join Date
    Mar 2004
    Posts
    9
    of course there is a submit button, but I didn't write the whole script down here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •