Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Mail irregularities after changing hosting providers

the mail() function

Moderators: macek, egami, gesf

Mail irregularities after changing hosting providers

Postby d60eba » Mon Sep 22, 2003 4:05 am

Hello all,

The website I run uses the mail function to send email to a variety of people in the To: Line, sometimes to a user in the CC: line and always to an admin in the BCC: Line.

This was all working great on my previous hosting solution. However, we recently changed hosts and now the following has occured:

- The To: recipients don't receive the emails
- The CC: recipient doesn't receive the email
- The BCC: recipient DOES receive the email, and in that email all the headers are correct

I was wondering is anyone could come up with some ideas as how to troubleshoot this problem?

Example code follows here:-

-------in config.php-----------
Code: Select all
$mail_to_cash_back = "sales@pitch-invasion.com";
---------------------------------

-------in example.php---------
Code: Select all
   ######## Build the message   
      
   $msg .= "<font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\">";
   
   $msg .= "<b>£25 Cash Back Referral</b><br><br>";
      
   $msg .= "league_name: $row->league_name<br>";
   
   ############ PUT EACH SUBMITTED VARIABLE INTO THE MESSAGE   
      
             foreach($HTTP_POST_VARS as $key=>$value) {
    $msg .= "$key: $value <br>";
   
}   
    $msg .= "</font>";
   
   $msg = str_replace("league_name:","<b>Referrer Details</b><br>league_name:",$msg);
   $msg = str_replace("name_lead","<br><b>Lead Details</b><br>name_lead",$msg);
   $msg = str_replace("id_submission_type","<br><b>Tech Details (ignore)</b><br>id_submission_type",$msg);
      
$subject = "£25 Cash Back Referral";
$mailheaders = "Content-type: text/html; charset=iso-8859-1\r\n";
$mailheaders .= "MIME-Version: 1.0\r\n";
$mailheaders .= "From: Pitch Invasion Admin \n";
$mailheaders .= "BCC: $BCC";
$mailheaders .= "CC: $CC";
mail("$mail_to_cash_back", "$subject", $msg, $mailheaders);
---------------------------------------

Many thanks in advance for any help.

Regards,

Leon Chevalier
d60eba
New php-forum User
New php-forum User
 
Posts: 6
Joined: Wed Jul 02, 2003 7:19 am
Location: Barcelona

Postby d60eba » Fri Sep 26, 2003 3:47 am

Hi,

I worked out what the problem was:

Code: Select all
"From: Pitch Invasion Admin \n"


I changed this From: line to an actual email address and things started working again.

Regards,

Leon[/code]
d60eba
New php-forum User
New php-forum User
 
Posts: 6
Joined: Wed Jul 02, 2003 7:19 am
Location: Barcelona

Postby sigix » Mon Sep 29, 2003 4:05 am

also refer to some pages that describe the mail headers ...
sigix
php-forum Active User
php-forum Active User
 
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.