JJohnsenDK Posted May 5, 2008 Share Posted May 5, 2008 Im having problems sending mails from my webserver. I have tried to make a small php script which sends a simple mail: <?php $to = "[email protected]"; $subject = "Test af mail sendning"; $message = "Jaaah, dette er så en test."; $headers = "From: [email protected]"; echo "<h2>This sends mail to ".$to."</h2>"; if(mail($to, $subject, $message, $headers)){ echo "Send!"; }else{ echo "Could'nt send the mail "; } ?> And it unfortunally shows: "Couldnt send the mail ". What could be wrong? Can i in any way test my webserver? Link to comment https://forums.phpfreaks.com/topic/104180-cant-send-mail-from-webserver/ Share on other sites More sharing options...
AP81 Posted May 5, 2008 Share Posted May 5, 2008 Do you have Postfix or sendmail installed? Does typing "man mail" on command line give you a manual page? Postfix or Sendmail are required in order for the mail function to work. Link to comment https://forums.phpfreaks.com/topic/104180-cant-send-mail-from-webserver/#findComment-533358 Share on other sites More sharing options...
JJohnsenDK Posted May 5, 2008 Author Share Posted May 5, 2008 how do i check if one of those are installed? the webserver is running on a Zend Core installation. Link to comment https://forums.phpfreaks.com/topic/104180-cant-send-mail-from-webserver/#findComment-533372 Share on other sites More sharing options...
JJohnsenDK Posted May 5, 2008 Author Share Posted May 5, 2008 anyone who can help? Link to comment https://forums.phpfreaks.com/topic/104180-cant-send-mail-from-webserver/#findComment-533422 Share on other sites More sharing options...
rhodesa Posted May 5, 2008 Share Posted May 5, 2008 Is this on a hosting service? A lot of hosting services have started filtering stuff from mail() that has a From header they don't like. Try using a From email that is from the same domain as a test. And obviously, check your spam filters.... Link to comment https://forums.phpfreaks.com/topic/104180-cant-send-mail-from-webserver/#findComment-533433 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.