Link to home
Start Free TrialLog in
Avatar of aot2002
aot2002

asked on

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);                    
   }



}

   



?>
Avatar of JB04
JB04

What do you mean the code is missing ?
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
Avatar of aot2002

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of davebytes
davebytes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aot2002

ASKER

thanks