SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: mail()

  1. #1
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mail()

    Hi,

    Has anyone encountered problems with this?
    Some mail servers do not receive the emails that are sent using this function.

    Example, sourceforge.net servers

    Does anyone have any knowledge on this? thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's much much much more likely that you're doing something wrong than mail() is.
    ck :: bringing chris to the masses.

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's my code,

    PHP Code:
        $moddate time();
        
    $hour 12 3600;
        
    $newtime $moddate+$hour;
        
    $time date("d/m/y H:i:s"$newtime);

        
    $headers "From: <" $user_email ">\n";
        
    $headers .= "Reply-To: <" $user_email ">\n";
        
    $headers .= "X-Sender: <" $user_email ">\n";
        
    $headers .= "X-Mailer: $script_name\n";
        
    $headers "DATE : $time\n";
        
    $headers .= "Return-Path: <" $user_email ">\n";
        
    $headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
        
    $message stripslashes("$message");

        
    mail("$email","$system_name | $subject","$message2","$headers"); 
    even a normal code like

    PHP Code:
        $sendmail mail ("XXXXX@users.sourceforge.net""Subject""Message : Hello!");
        if (
    $sendmail) echo 'E-Mail Sent';
        else echo 
    'E-Mail not Sent'
    does not work. it shows email sent, but i don;t receive the email
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  4. #4
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats a problem with your sendmail or the other mail program you are using... check your email logs to verify something was sent out..
    i dunno...

  5. #5
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well two things. First is your php.ini file may have nobody set as the default from user, which some servers discard as spam. Second, you are missing the . in front of the = on the DATE line...
    $headers = "DATE : $time\n";
    should be
    $headers .= "DATE : $time\n";
    otherwise you're erasing From, Reply-to, etc.
    Kevin

  6. #6
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by tubedogg
    Well two things. First is your php.ini file may have nobody set as the default from user, which some servers discard as spam. Second, you are missing the . in front of the = on the DATE line...
    $headers = "DATE : $time\n";
    should be
    $headers .= "DATE : $time\n";
    otherwise you're erasing From, Reply-to, etc.
    thanks.
    the date was a mistake on my part when making the post. i included the . in my script.

    i noticed that if i sent the mail without specifying a 'from', when a person receives the email, its 'nobody' and email is like the server host name.

    is that the cause of it?
    but as i said, when specifying a From user, its alright. any clues?


    Originally posted by kunal
    thats a problem with your sendmail or the other mail program you are using... check your email logs to verify something was sent out..
    how do i check the email logs?
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  7. #7
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    being on a free host, you most likely can't. not sure about sourceforge though.
    contact your tech support for sourceforge to find out if you can have/have access to email logs.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  8. #8
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Defender1
    being on a free host, you most likely can't. not sure about sourceforge though.
    contact your tech support for sourceforge to find out if you can have/have access to email logs.
    no. I'm on hostrocket. the problem with emails not arriving resides on sourceforge mail servers.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  9. #9
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, my previous instructions should still apply.
    contact your tech support and ask em
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  10. #10
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is not a very technically detailed answer because I don't know the technical details, however, this is my guess on what is happening. The sourceforge sendmail or whatever SMTP server is not accepting you mail because you are "spoofing" the X-Sender and X-mailer headers and it is onto you Why do you need to spoof these headers? Perhaps the best thing is to contact sorceforge and ask them why their server doesn't accept the mail and show them your code.

  11. #11
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by freakysid
    This is not a very technically detailed answer because I don't know the technical details, however, this is my guess on what is happening. The sourceforge sendmail or whatever SMTP server is not accepting you mail because you are "spoofing" the X-Sender and X-mailer headers and it is onto you Why do you need to spoof these headers? Perhaps the best thing is to contact sorceforge and ask them why their server doesn't accept the mail and show them your code.
    uh huh..that really has alot of sense..i'll try without it and let yo uknow the results. thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


Bookmarks

Posting Permissions

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