problem with mail function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swethak
    New Member
    • May 2008
    • 118

    problem with mail function

    hi,

    i run the below code i got the below error when i run in my local system.And i placed same program in website it works fine.plz tell that what's the mistake in that.

    [php]

    <?php
    $to ="aa@gmail.com" ;
    $subject = "Site Registration Confirmation";
    $message = '<html>
    <head>
    <title>Site Registration Confirmation</title>
    </head>
    <body style=font-family:verdana, arial; font-size: .8em;>
    You filled out a registration form
    <br/><br/>
    </body>
    </html>';
    //headers type to sent the mail
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\n";
    $headers .= "X-Priority: 3\n";
    $headers .= "X-MSMail-Priority: Normal\n";
    // from address is take what ever we want
    $from = "me@example.com ";
    $headers .= "From: $from";
    //mail function
    mail($to,$subje ct,$message,$he aders);
    ?>

    [/php]

    error :Warning: mail(): "sendmail_f rom" not set in php.ini or custom "From:" header missing in e:\project\Data Mining\mailchec k.php on line 22
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Please read about the mail function's additional header parameters here Good luck.

    Comment

    • neetendra
      New Member
      • Jul 2008
      • 1

      #3
      First of all you go to php.ini and change the "sendmail_f rom" to your email id.... and want to more about plz click http://in.php.net/function.mail

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        The highlights of which would be that the additional headers must include a From header, whether that is set in the additional_head ers parameter or via the php.ini directive.

        Comment

        Working...