php mail function

Discussion in 'PHP' started by googlehelper, Jan 17, 2009.

  1. #1
    mail is not working . I am using apache on linux Fedora8 and am on a local host plz tell me why it doesnt work should i make any configurations

    and how do i /usr/sbib/sendmail
     
    googlehelper, Jan 17, 2009 IP
  2. IGiveMoney

    IGiveMoney Peon

    Messages:
    116
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    
    
    Code below works without errors
    <?php
    
    $Name = "Da Duder"; //senders name
    $email = "email@adress.com"; //senders e-mail adress
    $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient
    $mail_body = "The text for the mail..."; //mail body
    $subject = "Subject for reviever"; //subject
    $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
    
    mail($recipient, $subject, $mail_body, $header); //mail command :)
    ?>
    
    
    
    
    
    
    
    
    
    
    
    
    
    PHP:
     
    IGiveMoney, Jan 17, 2009 IP
  3. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #3
    maybe your host has disabled phpmail
     
    Bohra, Jan 17, 2009 IP
  4. Linked2K

    Linked2K Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Maybe your host has disabled it or their IP is in spam blacklist. Try sending to an email with no spam filtering.
     
    Linked2K, Jan 18, 2009 IP
  5. googlehelper

    googlehelper Peon

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    i tried sanding mail to my gmail account it didnt work how do enable php mail if it's disabled
     
    googlehelper, Jan 19, 2009 IP