Hello, I am trying to use the Mail function to send an email message from a contact form to myself, but I am coming across some errors. My ini file looks like this:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
mail.force_extra_parameters = sendmail_from
My code in the PHP Script looks like this:
$from = $email;
$to = "newhorizondesigns@hotmail.com";
$subject = "Contact Form Submission on New Horizon Designs";
$body = "Hello, the email submitted is $email. The services selected are $serivces";
print "Thank you for submitting the form. I will try and get back to you as soon as I can.";
mail($to, $subject, $body, $from);
$email is entered earlier in the form and is getting passed correctly. I have tried discluding the $from in the mail function and I get the same error message, here it is:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\xampp\eclipsePHP\formSubmit.php on line 52