PHP MAILER wont work on linux

its wierd im using a phpmailer program which the code works fine on windows XP.
if i put it on linux machine it will mail the email out but the code is missing?


<?php
    session_start();
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
set_time_limit (1900);

    include_once 'mysql_query.php';
    include_once 'checkp.php';
     //include the class !
     include_once 'invoice_quote_create.class';

function emailthem($email, $PID) {      
   include_once "class.phpmailer.php";

 //Declare Class of Invoice Template
  $temp = new invoice_quote_create_template("invoice_template2.html");
       
$saywhat = "
TEST HTML <br>
$body
";
        $temp->SetParameter("say", $saywhat);
        $message = $temp->CreatePage("true");
       
$mail = new PHPMailer();

$mail->IsSMTP();                                      // set mailer to use SMTP
$mail->Host = "127.0.0.1";  // specify main and backup server
$mail->SMTPAuth = false;     // turn on SMTP authentication

$mail->From = "customerservice@MYDOMAIN.com";
$mail->FromName = "Sales";

$mail->AddAddress($email);


$mail->WordWrap = 50;                                 // set word wrap to 50 characters
$mail->IsHTML(true);                                  // set email format to HTML

$mail->Subject = "Website";
$mail->Body    =  $message;

$mail->AltBody = "
TEST  \n
";

if(!$mail->Send())
{
   echo "Quote could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
   exit;
}else{
      
id='$prikey'", " ", "");
}
      
//echo "Your Quote has been sent ! $a $email <br>";

}







$results = mysqlstatement("SELECT * FROM que_p", "", "", "");

for($a=0; $a < $results['totalrows']; $a++){
      
      
      $id = $results['id'][$a];
      $int = $results['interchange'][$a];
      $PID = $results['PID'][$a];
      $email = $results['email'][$a];
      
      //echo $int;
      
      if($email == ""){
            $email = "noemailentered@MYDOMAIN.com";
      }

//remove it so no duplicates
      $removeitem = mysqlstatement("delete from que_p where id='".$results['id'][$a]."'", "","");       

      
$findint = mysqlstatement("SELECT * FROM p_database where id='$PID' limit 2", "", "", "");      
      if($findint['totalrows'] > 0){
                  //email person if its already found !
                  echo "email them";
                  emailthem($email,$PID);                    
                  continue;
            }
      
       
  if($int != "") {
      emailthem($email,$PID);                    
   }



}

   



?>
LVL 1
aot2002Asked:
Who is Participating?
 
davebytesCommented:
$mail->Body    =  $message;

have you tried printing out $message, to verify there's something in it?  echo($message) or die($message) or something?  Or just hardcoding Body to a test string?  I assume the subject comes through set?

If the mail goes out and shows up, but is otherwise blank, that'd be my first test...
0
 
JB04Commented:
What do you mean the code is missing ?
0
 
davebytesCommented:
Yeah.  I'm actually a bit surprised that'd work on the average box... I guess a non-hosting system would typically have sendmail set up.  But on hosted stuff on the net, usually you'd need a particular SMTP server IP to go through.  What is failing?  (I should note I've used PHPMailer on linux for like two years plus, though sometimes used SMTP, sometimes used mail(), depending on the host box...)

-d
0
 
aot2002Author Commented:
JB04
it just sends a blank email? nothing in it? but the email does go out? wierd
------------------------------------------------




Comment from davebytes
so what is it your suggesting to fix this?
0
 
aot2002Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.