volatileboy Posted July 5, 2010 Share Posted July 5, 2010 Hey people, could anyone help me, I have had problems with the mail() function for years, the main problem is that it won't always send and be recieved by people, I know there are a million different methods to do this but I will show you basically what I am using, after many attempts it sends to a majority of people but I am still getting people complaining that they haven't recieved the activation email, anyway here is the code: $to = $email; $subject = 'Dark Eden Oblivion - Confirm Account'; $headers = 'From: noreply@darkedenoblivion.com' . '' . "\n"; $headers .= 'Reply-To: noreply@darkedenoblivion.com' . '' . "\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; $message = "Thanks for signing up to play Dark Eden Oblivion, we now need you to confirm this email address visiting the following link:\n\n <a href=\"http://www.darkedenoblivion.com/c.php?id=" . $act . "\">http://www.darkedenoblivion.com/c.php?id=" . $act . "</a>"; $subject = "Dark Eden Oblivion - Confirm Account"; mail($to, $subject, $message, $headers); I hope someone can help me out! Quote Link to comment https://forums.phpfreaks.com/topic/206769-annoying-php-mail-problem/ Share on other sites More sharing options...
ChemicalBliss Posted July 5, 2010 Share Posted July 5, 2010 Your mail could be routed into JUNK folders, or your SMTP program.Host is not stable. Sometimes it can take a while for SMTP servers to process specific emails because of queues on that system. I would check for any errors reported by your SMTP server itself. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/206769-annoying-php-mail-problem/#findComment-1081313 Share on other sites More sharing options...
volatileboy Posted July 5, 2010 Author Share Posted July 5, 2010 Is there a reason why it might be placed in peoples junk mail folders? I mean is there ways around this? Most of my users do check their junk mail folders for the activation email but avoiding this would be preferable. I do get mails to my hosts main account prompting me when an activation email failed to send, if I post this here would it help? Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/206769-annoying-php-mail-problem/#findComment-1081316 Share on other sites More sharing options...
premiso Posted July 5, 2010 Share Posted July 5, 2010 You can try one other option in the mail deal: mail($to, $subject, $message, $headers, "-fnoreply@darkedenoblivion.com"); You can check if your IP has an MX record associated with it. If it does not, this is often a first check point for the free mail providers to test if it is spam. Something to look into, given that the above does not decrease the amount of messages sent to the junk mailbox. Another option is to ask your host about it. Quote Link to comment https://forums.phpfreaks.com/topic/206769-annoying-php-mail-problem/#findComment-1081319 Share on other sites More sharing options...
kenrbnsn Posted July 5, 2010 Share Posted July 5, 2010 You can try making the line ends consistent, instead of <?php $headers = 'From: noreply@darkedenoblivion.com' . '' . "\n"; $headers .= 'Reply-To: noreply@darkedenoblivion.com' . '' . "\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; ?> do <?php $headers = "From: noreply@darkedenoblivion.com\r\n"; $headers .= "Reply-To: noreply@darkedenoblivion.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=UTF-8\r\n"; $headers .= "Content-Transfer-Encoding: 8bit\r\n"; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/206769-annoying-php-mail-problem/#findComment-1081343 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.