JJohnsenDK Posted May 15, 2008 Share Posted May 15, 2008 Hey Im having some problems with sending mails via my mailserver, or atleast i think it is my mail server that is the problem. I made this script: <?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 "; } It returns Send! so the mail() function does its work, right? But i dont get any mail and i have also chekced my junk mail. I tried 3 different mail accounts, but notthing. What is wrong? Is it the mailserver which doesnt send the mail or? Link to comment https://forums.phpfreaks.com/topic/105704-help-with-sending-mails/ Share on other sites More sharing options...
redarrow Posted May 15, 2008 Share Posted May 15, 2008 try this if it dosent work then post your php.ini settings for mail......... <?php $to = '[email protected]'; $subject = 'Wakeup bob!'; $message = '<b>yo</b>, whassup?'; $headers = "From: [email protected]\r\n" . 'X-Mailer: PHP/' . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; // Send mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/105704-help-with-sending-mails/#findComment-541574 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.