Mail irregularities after changing hosting providers

the mail() function

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Wed Jul 02, 2003 7:19 am
Location: Barcelona

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 = "";

-------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>";
             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.


Leon Chevalier

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

Fri Sep 26, 2003 3:47 am


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.



php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Mon Sep 29, 2003 4:05 am

also refer to some pages that describe the mail headers ...
something strange will be ...

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest