|  | -
-
- QUESTION:
- PHP mail () does not work.
ANSWER: - We have been having problems with this on various servers, here is code to directly call sendmail, to work around the PHP mail() problem until cpanel.net rolls out a fix.
// Configuration $announce_subject = "Message From Our Web Site"; $announce_from_email = "test@mysite.com"; $announce_from_name = "Our Site"; $announce_to_email = "someone@domain.com"; $body = "Announcement. Our site has a special offer today. Please visit. Thank you."; $MP = "/usr/sbin/exim -v"; $spec_envelope = 1; // Access Sendmail // Conditionally match envelope address if($spec_envelope) { $MP .= " $announce_to_email"; } $fd = popen($MP,"w"); fputs($fd, "To: $announce_to_email\n"); fputs($fd, "From: $announce_from_name <$announce_from_email>\n"); fputs($fd, "Subject: $announce_subject\n"); fputs($fd, "X-Mailer: PHP4\n"); fputs($fd, $body); pclose($fd);
?> ############################################################ Please be advised that this is a SUPPLEMENTAL Online Manual.
The PRIMARY Online Manual is inside your Online Control Panel... to access it, just click Documentation link at very bottom of Online Control Panel screen.
You should always consult the Online Manual inside your control panel first... and only consult this SUPPLEMENTAL Online Manual as a last resort. if after consulting the Control Panel Documentation, you still need assistance, please CONTACT SUPPORT top | | |