Email send problem

Discussion in 'PHP' started by nabi bux, Aug 13, 2007.

  1. #1
    Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Domains\sachalsoft.com\wwwroot\nabibux\index1.php on line 9
    I m facing the above error when try to run the code to send email
    please visit this url where i place the code

    http://nabibux.sachalsoft.com/index1.php
    where i put the script to
    see my smtp server info
    http://nabibux.sachalsoft.com/index.php
    by usiing above link you can see the configuration of sever where i host my site
    i dont have permission to chage any thing in the sever now please tell how i send mail using php script
    i have the following code

    <?php

    $to_addr = 'nabibux@sachalsoft.com';

    if (isset($_REQUEST['submit'])) {
    $mail_body = 'Name: '.$_REQUEST['name'];
    $mail_body .= "\nEmail: ".$_REQUEST['email'];
    $mail_body .= "\nMessage: ".$_REQUEST['message'];
    mail($to_addr,'Form Feedback',$mail_body);
    print "Thank you for the feedback.";
    } else {
    print<<<_HTML_
    <form method="POST" action="$_SERVER[PHP_SELF]">
    <table>
    <tr><td>Name:</td><td><input type="text" name="name"></td></tr>
    <tr><td>Email:</td><td><input type="text" name="email"></td></tr>
    <tr><td>Message:</td><td><textarea name="message"></textarea></td></tr>
    <tr><td colspan="2"><input name="submit" type="submit"></td></tr>
    </form>
    _HTML_;
    }

    ?>

    Thanks please help

    :mad:
     
    nabi bux, Aug 13, 2007 IP
  2. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try adding...

    ini_set ("sendmail_from","a.body@acompany.com");

    to force the From header before calling the mail function.
     
    ecentricNick, Aug 13, 2007 IP
  3. nabi bux

    nabi bux Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for help i got it now thanks tooooo:D
     
    nabi bux, Aug 13, 2007 IP