PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The following class is adapted from the php developer's cookbook used for sending HTML or attachments, I used it for my application to send out a mail but to no avail, can somebody pls advice.
<?php
function send_html($to, $subject, $message)
{
/* To send HTML mail, set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
if(mail($to, $subject, $message, $headers))
return true;
else
echo false;
}
?>
however, i cannot send any mails based on the if i instantiate the the object mm, I've trouble shoot the code by echoing the attributes of the class there's output, however the mail function inside the class just don't seem to be activated..
Have you added any debugging into the send() function in the MIME class? Maybe having a simple e-mail sent at the same time? Checking the output of $this->to,$this->subject and $this->build()?
yeah, there's nothing when I tried to echo build(), seems like the mail function in the MIME class has been crippled because of that. Any clues why is this so?
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 51
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 51
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 52
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 52
Notice: Use of undefined constant filename - assumed 'filename' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 54
Notice: Undefined variable: attachments in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 54
Notice: Undefined variable: attachments in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 54
From: xyz Content-type:multipart/mixed; boundary = b8c0aa9ff7af25e30bf72dae17f11f4d0 This is a MIME encoded message. --$b8c0aa9ff7af25e30bf72dae17f11f4d0Content-type: text/plain Content-Transfer-Encoding: 8bit --b8c0aa9ff7af25e30bf72dae17f11f4d0 --; name = ""--b8c0aa9ff7af25e30bf72dae17f11f4d0-- header - From: xyz Content-type:multipart/mixed; boundary = b8c0aa9ff7af25e30bf72dae17f11f4d0 This is a MIME encoded message. --$b8c0aa9ff7af25e30bf72dae17f11f4d0Content-type: text/plain Content-Transfer-Encoding: 8bit --b8c0aa9ff7af25e30bf72dae17f11f4d0 --; name = ""--b8c0aa9ff7af25e30bf72dae17f11f4d0--
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 51
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 51
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 52
Notice: Use of undefined constant data - assumed 'data' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 52
Notice: Use of undefined constant filename - assumed 'filename' in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 54
Notice: Undefined variable: attachments in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 54
Notice: Undefined variable: attachments in C:\Program Files\Apache Group\Apache\htdocs\swimcentral\user\functions\email_fns.php on line 54
From: xyz Content-type:multipart/mixed; boundary = b0752fc3d2d6ba7b87c1e7053b8cb57f1 This is a MIME encoded message. --$b0752fc3d2d6ba7b87c1e7053b8cb57f1Content-type: text/plain Content-Transfer-Encoding: 8bit --b0752fc3d2d6ba7b87c1e7053b8cb57f1 --; name = ""--b0752fc3d2d6ba7b87c1e7053b8cb57f1--
by the way, the mail is working now, except with no content..
?>