PHP MAILER wont work on linux

Posted on 2006-04-09
Last Modified: 2008-03-06
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?

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 = "
        $temp->SetParameter("say", $saywhat);
        $message = $temp->CreatePage("true");
$mail = new PHPMailer();

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

$mail->From = "";
$mail->FromName = "Sales";


$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

   echo "Quote could not be sent. <p>";
   echo "Mailer Error: " . $mail->ErrorInfo;
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 = "";

//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";
  if($int != "") {



Question by:aot2002
    LVL 7

    Expert Comment

    What do you mean the code is missing ?
    LVL 17

    Expert Comment

    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...)

    LVL 1

    Author Comment

    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?
    LVL 17

    Accepted Solution

    $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...
    LVL 1

    Author Comment


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now