title: php mailer attachments
body: <p>I have been using this script to send emails to certain staff but because of changes to my system i have to now send attachements with the email and i have tried multipul peices of code to accomplish this but have been unsuccessful... I still recive the email but without the attachement which is quite pointless in this case i have placed the script i am using bellow </p>
  
  <p>i have removed the real addresses i was using and smtp server </p>
  
  <pre><code>    require("PHPMailer/class.phpmailer.php");
  
  $mail = new PHPMailer();
  
  $mail-&gt;IsSMTP();    // set mailer to use SMTP
  $mail-&gt;Host = "SMTP.SErver.com";    
  
  $mail-&gt;From = "From@email.com";    
  $mail-&gt;FromName = "HCSC";  
  $mail-&gt;AddAddress("To@email.com", "Example"); 
  $mail-&gt;AddReplyTo("Reply@email.com", "Hcsc"); 
  
  $mail-&gt;WordWrap = 50;    
  $mail-&gt;IsHTML(false);    
  
  $mail-&gt;Subject = "AuthSMTP Test";
  $mail-&gt;Body    = "AuthSMTP Test Message!";
  $mail-&gt;AddAttachment("matt.txt"); //this is basicly what i am trying to attach as a test but will be using excel spreadsheets in the production
  
  if(!$mail-&gt;Send())
  {
     echo "Message could not be sent. &lt;p&gt;";
     echo "Mailer Error: " . $mail-&gt;ErrorInfo;
     exit;
  }
  
  echo "Message has been sent";
  </code></pre>
  
  <p>i have also tried a few other emtods of attaching the file but none seem to work any help is greatly appricated</p>