1

Setting xampp to be able to send emails through the localhost. Used this guys instructions http://www.root25.com/2014/04/send-email-using-xampp-from-localhost.html and it was pretty straight forward.

It comes up with an error message:

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\process.php on line 56

PHP CODE

if (!($formerrors)) :
    $to         =   "email@email.com";
    $subject    =       "From $myname -- Contact/Booking Page";
    $message    =       "$myname filled out the form";
    $headers    =  'MIME-Version: 1.0' . "\r\n"; 
    $headers    .= 'From: Patrick <email@email.com>' . "\r\n";
    $headers    .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 

    $replyto    =       "From: $email \r\n".
                                "Reply-To: secondemail@email.com" . "\r\n";

    if (mail($to, $subject, $message, $headers)):
        $msg = "Thanks for filling out our form";
    else:
        $msg = "Problem sending the message";
    endif; // mail form data

endif; // check for form errors

Not sure what the problem is here. Any advice?

Patrick McDermott
  • 1,220
  • 1
  • 15
  • 30
  • You probably haven't got a sender specified in your php.ini file, so you'll need to add it in an additional header as per e.g. http://stackoverflow.com/questions/28026932/php-warning-mail-sendmail-from-not-set-in-php-ini-or-custom-from-head – Joel Hinz Jul 29 '15 at 17:34
  • http://stackoverflow.com/questions/19243826/php-mail-results-in-error-header-missing – callmemath Jul 29 '15 at 17:35

0 Answers0