this is my mail script trying to send mail from my server.
<?php
$subject = 'This is an HTML email.';
$smtp_server = 'smtp.mydomain.com';
$from = $smtp_username = 'info@mydomail.com';
$smtp_password = 'mypassword';
$html = 'This is an <strong>HTML</strong> <i>formatted</i> email!';
$text = strip_tags($html);
$to = 'ramsai.php@gmail.com';
//$cc = array('foo@example.com');
//$bcc array('bar@example.com', 'baz@example.com');
// send the message
$result = sendMail($subject, $smtp_server, $smtp_username, $smtp_password, $html, $text, $to);
// check to see if the message was sent properly
if ($result !== true) {
echo 'There was an error sending the message. ('.$result.')';
} // end if the message was not sent properly
else {
echo 'Message sent successfully.';
} // end else the message was sent properly
?>
When i am trying to run this script in my godaddy server i am getting fatal error:
Fatal error: Call to undefined function sendMail() in /home/content/99/7916299/html/EMRXXX/EMRnew/Patient/sendmail1.php on line 13
Thank you in advance,
Ramsai
Fatal error: Call to undefined function sendMail()
Means you forgot to include your
sendMail()user function. Because there is no native phpsendMail()function…You should use the native mail() function and setup your server to use sendmail (smtp) within your php.ini file:
mail($to,$subject,$content,$headers);