Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    713
    Thanks
    6
    Thanked 2 Times in 2 Posts

    about mail() function

    i used following codes

    $success=mail($to,$subject,$body);

    but the problem is when i send to yahoo mail. the from colunm display "nobody", how to show the sender's name on it.
    flying dagger

  • #2
    Regular Coder
    Join Date
    May 2005
    Posts
    563
    Thanks
    0
    Thanked 3 Times in 3 Posts
    try using this

    PHP Code:
    $headers 'From: Someone <someone@somewhere.com>'."\r\n"//from
    $headers .= 'Content-Type: text/html; charset="ISO-8859-1"'."\r\n"//if you want content to be html
    $success=mail($to,$subject,$body,$headers); 

  • #3
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You also have to send a mime header.

    PHP Code:
    <?php
    mail
    ('recipient@some.net''Subject',
        
    '<html><body><p>Your <i>message</i> here.</p></body></html>',
        
    "To: The Receiver <recipient@some.net>\n" .
        
    "From: The Sender <sender@some.net>\n" .
        
    "MIME-Version: 1.0\n" .
        
    "Content-type: text/html; charset=iso-8859-1");
    ?>
    If you want more information there's a good tutorial/article on sitepoint.
    Last edited by mrruben5; 06-07-2005 at 10:44 AM.
    CATdude about IE6: "All your box-model are belong to us"


  •  

    Posting Permissions

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