Welcome, Guest
  • Author Topic: I do not get mails? - troubleshooting help  (Read 18703 times)

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    I do not get mails? - troubleshooting help
    « on: 01/20/02, 18:41 »
    To get started - I just saw this great piece of code:
    unless open(MAIL, "|/usr/lib/sendmail") {
    The poor guy will never get mail...

    so - how to check for errors: first of all: if it is your own script, add sensible checks to your script
    for cgi script: open will only fail if the server cannot setup even one shitty pipe for your script; it would not do much sensible work in this situation anyway. If the mail prog is missing (wrong path) or not working, you will get an error on write (once you reach 4096 characters of message) or on close. So,
    close MAIL or die "status=probelm with mailer";
    will possibly report about problem. Note that standard headers (content-type) must be sent before doing that (or in the process of reporting the error), or you would get a plain 500 error instead of the message.
    for php script: no luck; the sysadmin sets mail parameters for you (so unlike cgi you do not have to find out the path to the local sendmail program) but there is no error message to the user if the admin did that wrong - the only real error from php is "mail not configured/allowed at all"

    next, try to actually view the messages - add a status text box to your movie to show the response sent.

    still lost? you are absolutely sure your movie and your script are in the same subdomain - not www.yoursite.com and cgi.yoursite.com or similar? Time to build a html form with the same variables you are using in your movie. If you submit the form, you may see such nasty messages as "error 500" that never make it into your flash movie

    if you have to use script provided by your hosting company, like Matt's formmail: check with html form too. If it works in html but not in flash (and you were using IE), try Netscrape. If it works in N4 but not IE, most likely the hosting company has changed the script to require referrers. Talk to your hosting company and tell them in nice words that they are idiots.
    While you are trying NN: you do not see a movie at all, but rather only weird text starting with FWS - tell them they are BIG idiots

    You got it to work with html but not with your movie in either browser? Maybe it is not the server's fault, but your movie is not sending at all....

    Musicman

    Manojo

    • Server what's that
    • *
    • Posts: 30
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #1 on: 02/21/02, 12:28 »
    Hi! The mails were not sending in my e-mailer, so I came to this board.
    My code is all correct, but I didn't understand what I should do if it still doesn't work. Could you please explain it all once again?
    Thanks a lot. By the way, I'm using PHP.

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    troubleshooting help - PHP
    « Reply #2 on: 01/16/03, 02:49 »
    Since spring 2002, new php versions work slightly different from old ones. Now, some servers updated the day after the software was out, others may take three years...
    In any case, if your server runs PHP 4.1 or later, you need to modify your script
    Code: [Select]

    <?
    [b]// data coming in from the movie
    $Email = $_POST[Email];
    $FirstName = $_POST[FirstName];
    $Company = $_POST[Company];
    $ToComments = $_POST[ToComments];
    $HearAbout = $_POST[HearAbout];[/b]

    $ToEmail = "jeff@snowvids.com";
    $ToName = "Jeff";
    $ToSubject = "Example Mail from SendMail Tutorial";

    [b]// next line is a recommended change if your "comments" field is multiline
    $ToComments = str_replace("\r", "\n", $ToComments);[/b]

    $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nSenders Company: $Company\n\n
        Message Sent:\n$ToComments\n\nSender Heard About Site From: $HearAbout\n";
    $EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If you feel that you
        recieved this e-mail by accident please contact us at www.yourSite.com";
    $Message = $EmailBody.$EmailFooter;
    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");
    Print "_root.Mail.EmailStatus=Complete - Your mail has been sent";
    ?>


    If you do not know which php version your server is running, create the following script
    Code: [Select]

    <? phpinfo(); ?>

    and upload it to y our webspace as phpinfo.php
    Open it in the browser as http://www.yoursite.com/phpinfo.php

    Also, you might want to try this script as well
    Code: [Select]

    <? mail("you@yoursite.com", "test mail", "this is a test"); ?>

    to see whether any mail gets back to you.

    Musicman

    nubian

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • ..::: NUBIAN :::..
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #3 on: 03/03/03, 15:51 »
    i've been trying to get this snowmail figured out for the longest now.
    yes my server php version is 4.3.0
    and all of my php scripts work fine except for this and i can't figure out why.  ???
    i was using the old snowmail php script that didn't send mail at at because it got stuck at the part where it says, "Sending... one Moment .. or two.. sometimes it's faster then other times"
    i've erased that script and placed the revised version of jeff's snowmail php script.
    now it's says it sends mail but i don't receive anything.

    this is the php code i'm using:

    <?php
    // A revised version of the old snowMailPHP.php from Flash-db.  

    $Email       = $HTTP_POST_VARS["Email"];
    $FirstName    = $HTTP_POST_VARS["FirstName"];
    $ToEmail    = $HTTP_POST_VARS["ToEmail"];
    $ToName      = $HTTP_POST_VARS["ToName"];
    $Company   = $HTTP_POST_VARS["Company"];
    $ToComments = $HTTP_POST_VARS["ToComments"];
    $HearAbout    = $HTTP_POST_VARS["HearAbout"];

    // The subject of your email.
    $ToSubject       = "Example Mail from SendMail Tutorial";

    // This is a sample message.  The \n's are line breaks.  You can alter this message anyway you want.  It will be the main body of your email.  
    $Message       = "Sent By: $FirstName\nSenders Email: $Email\nSenders Company: $Company\n\nMessage Sent:\n$ToComments\n\nSender Heard About Site From: $HearAbout\n";

    // This line actually sends the mail. For more information on this please visit:
    // www.php.net/manual/en/function.mail.php
    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");

    // Make sure to surround Name/Value pairs sent back to flash with &'s.  This is how flash seperates different, Name/Value pairs from text/scripts into Flash variables.
    Print "&_root.Mail.EmailStatus=Complete - Your mail has been sent&";
    ?>

    all of the variables in the flash movie are correct.

    also when i use this mail php script:
    <?
    mail("you@yoursite.com", "test mail", "this is a test");
    ?>

    i get mail no problem

    please help me!
    thanks in advance
    « Last Edit: 03/03/03, 18:04 by nubian »

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #4 on: 03/10/03, 17:42 »
    Hi,

    some servers do not like a
    John <john@serverxyz>
    style address as the first argument to mail() but only a simple
    john@server.xyz
    You may be able to put the full address into an extra To: header

    Musicman

    dijon

    • Server what's that
    • *
    • Posts: 1
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #5 on: 04/01/03, 17:49 »
    hey there, i just set this script up using php myself. everything works fine except for the:

    Print "_root.mail_form.EmailStatus=Complete - Your mail has been sent";


    (mail_form is the instance name of the form in my movie.)

    the EmailStatus displays the Sending Mail...etc. and never gets the completed message from the PHP script.

    the mail sends correctly though.

    any ideas?

    dijon

    Cetrez

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #6 on: 04/16/03, 05:54 »
    yea dijon,

    change it do this:
    Print "&_root.mail_form.EmailStatus=Complete - Your mail has been sent&";

    the difference is the '&' character in the beginning and in the end of the string, this tells flash somethin, actually I have no idea of what I'm talkin about but this does the trick ;)


    Cheers
    Cetrez

    nubian

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • ..::: NUBIAN :::..
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #7 on: 05/02/03, 01:50 »
     :(

    i did all of the above and still nada
    php works just fine on my server.
    i running flash guestbooks with php and mysql.

    my code:
    Code: [Select]

    <?
    [b]// data coming in from the movie
    $Email = $_POST[Email];
    $FirstName = $_POST[FirstName];
    $Company = $_POST[Company];
    $ToComments = $_POST[ToComments];
    $HearAbout = $_POST[HearAbout];[/b]

    $ToEmail = "this_is@notworking.com";
    $ToName = "notworking";
    $ToSubject = "Example Mail from SendMail Tutorial";

    [b]// next line is a recommended change if your "comments" field is multiline
    $ToComments = str_replace("\r", "\n", $ToComments);[/b]

    $EmailBody = "Sent By: $FirstName\nSenders Email: $Email\nSenders Company: $Company\n\nMessage Sent:\n$ToComments\n\nSender Heard About Site From: $HearAbout\n";
    $EmailFooter="\nThis message was sent by: $FirstName from $REMOTE_ADDR If you feel that you recieved this e-mail by accident please contact us at www.yourSite.com";
    $Message = $EmailBody.$EmailFooter;
    mail($ToName." <".$ToEmail.">",$ToSubject, $Message, "From: ".$FirstName." <".$Email.">");
    Print "&_root.Mail.EmailStatus=Complete - Your mail has been sent&";
    ?>


    it says email sent
    but recieve nada

    help!
    thanks  :(

    vesa kortelainen

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 3450
      • View Profile
    Re:I do not get mails? - troubleshooting help
    « Reply #8 on: 05/02/03, 02:55 »
    nubian : try this :

    // Create a new php file and add this line to it :
    <? mail("you@yoursite.com", "test mail", "this is a test"); ?>
    // Then run this new php file in your server



    « Last Edit: 05/02/03, 02:55 by vesa kortelainen »

    nubian

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • ..::: NUBIAN :::..
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #9 on: 05/06/03, 15:30 »
    vesa thanks a million,
    i tried that a while back.
    that does work with no problems no delay.
    still can't get this snowmail  to work.

    here is what the submit button look like:

    Code: [Select]
    on (release) {
        if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
            EmailStatus = "Please enter a valid E-mail address";
        } else if (!ToEmail.length || ToEmail.indexOf("@") == -1 || ToEmail.indexOf(".") == -1) {
            EmailStatus = "Please enter a valid E-mail address that you are sending this to";
        } else if (!ToName.length) {
            EmailStatus = "Please Enter the name of how you are sending this to";
        } else if (!FirstName.length) {
            EmailStatus = "Please Enter your name before Sending";
        } else if (!ToComments.length) {
            EmailStatus = "Please enter some text in you message";
        } else {
            loadVariablesNum("snowMailPHP.php", "0", "POST");
            EmailStatus = "Sending... one Moment .. or two.. sometimes it's faster then other times";
        }
    }
    « Last Edit: 05/06/03, 15:31 by nubian »

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #10 on: 05/08/03, 01:03 »
    Hi,

    have you already tried to make the first rgument to mail() just the $ToEmail - it seems to help with some mailers?

    Musicman

    nubian

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • ..::: NUBIAN :::..
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #11 on: 05/08/03, 01:09 »
    i'm not quite understanding what you mean by that.
    is it possible for you do display the difference in code?

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #12 on: 05/08/03, 11:17 »
    old: mail($ToName." <".$ToEmail.">",
    new: mail($ToEmail,

    Musicman

    nubian

    • Server what's that
    • *
    • Posts: 9
      • View Profile
      • ..::: NUBIAN :::..
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #13 on: 05/08/03, 17:44 »
     :)
    music, i hope you know why i replied with a smile.
    was a frustrating journey!
    thanks a million.

    Brett

    • Server what's that
    • *
    • Posts: 1
      • View Profile
      • Email
    Re:I do not get mails? - troubleshooting help
    « Reply #14 on: 06/20/03, 16:58 »
    <? mail("you@yoursite.com", "test mail", "this is a test"); ?>

    THis doesn't even run on my server.

    It's running PHP version 4.1.2

    I am using the same code as everyone else. Just won't send any email.
    Is there anything I have to request my server to change in his PHP config?

    Any help would be awesome.

    Thanks for your time.