Chud37 Posted March 1, 2012 Share Posted March 1, 2012 Hello, I have been using the mail() command for a while now, but for some reason It has just stopped functioning all together. I have added an OR DIE rule to the end of it and had no response. To all intents and purposes that mail is being sent - there are no errors whatsoever - just the mail is not getting delivered. I cannot think of anything I've done or changed that would stop it from being delivered, I haven't even been near the function that does it in a while. Here is the code: function sendMail($to,$ref) { $subject = 'Booking Confirmation'; $file = "receipts/$ref.htm"; $fh=fopen($file, "r"); $message = fread($fh, filesize($file)); fclose($fh); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Company <[email protected]>' . "\r\n"; mail($to, $subject, $message, $headers); } I have taken out the public names involved, but otherwise thats the code. It has worked absolutely fine in the past, and even If I strip out all of the filehandling part of it, and just use a simple $from - $to - $message, it still seems not actually send the mail. It wouldnt be so bad If I at least had an error to go on, but I dont I am just simply not getting the mail. Please help! ~Chud37 Link to comment https://forums.phpfreaks.com/topic/258031-send-mail/ Share on other sites More sharing options...
trq Posted March 1, 2012 Share Posted March 1, 2012 Have you checked your mail server logs? Link to comment https://forums.phpfreaks.com/topic/258031-send-mail/#findComment-1322663 Share on other sites More sharing options...
Chud37 Posted March 1, 2012 Author Share Posted March 1, 2012 I dont own the server, It is being hosted with a company, and they use the eXtend control panel. Whilst I prefere cPanel, I dont have a choice - and I cannot see anywhere in the eXtend control panel to view mail server logs.. Link to comment https://forums.phpfreaks.com/topic/258031-send-mail/#findComment-1322664 Share on other sites More sharing options...
Chud37 Posted March 1, 2012 Author Share Posted March 1, 2012 Aha, After testing I realised that my work domain where I was sending test emails to is the problem, for some reason that domain and that domain only isnt recieving my emails. I will close this thread, thank you! Link to comment https://forums.phpfreaks.com/topic/258031-send-mail/#findComment-1322688 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.