Jump to content

Annoying PHP Mail problem


volatileboy

Recommended Posts

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!

Link to comment
Share on other sites

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-

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.