$to = " jijodasgupta@gmail.com "; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("pMessage successfully sent!/p"); } else { echo("pMessage delivery failed.../p"); }
Wrote the php sendmail base code, but it gives me the following error:
Warning: mail () [function.mail]: "sendmail_from" is not set in php.ini or the custom header "From:" is not in C: \ xampp \ htdocs \ mail.php on line 5 Error sending messages ...
I modified the file `` php.ini and placed sendmail_from=jijodasgupta@gmail.com , but the problem still persists. Writing a mail script for the first time.
Am I doing something wrong? Is there a better way to do this?
source share