title: Sending Emails With phpmailer From A php Project?
body: <p>i want to send emails with phpmailer.</p>
  
  <p>for doing that i searched google and i found the blow link :</p>
  
  <p><a href="http://phpmailer.worxware.com/" rel="nofollow">http://phpmailer.worxware.com/</a></p>
  
  <p>so i download their libraries from here (by download link in their site , php 4-5):</p>
  
  <p><a href="http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php4/0.90/" rel="nofollow">http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php4/0.90/</a></p>
  
  <p>after that i refer to this example : (mean advanced using smtp)</p>
  
  <p><a href="http://phpmailer.worxware.com/index.php?pg=exampleasmtp" rel="nofollow">http://phpmailer.worxware.com/index.php?pg=exampleasmtp</a></p>
  
  <pre><code>&lt;?php
  require_once('../class.phpmailer.php');
  //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  
  $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
  
  $mail-&gt;IsSMTP(); // telling the class to use SMTP
  
  try {
    $mail-&gt;Host       = "mail.yourdomain.com"; // SMTP server
    $mail-&gt;SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
    $mail-&gt;SMTPAuth   = true;                  // enable SMTP authentication
    $mail-&gt;Host       = "mail.yourdomain.com"; // sets the SMTP server
    $mail-&gt;Port       = 26;                    // set the SMTP port for the GMAIL server
    $mail-&gt;Username   = "yourname@yourdomain"; // SMTP account username
    $mail-&gt;Password   = "yourpassword";        // SMTP account password
    $mail-&gt;AddReplyTo('name@yourdomain.com', 'First Last');
    $mail-&gt;AddAddress('whoto@otherdomain.com', 'John Doe');
    $mail-&gt;SetFrom('name@yourdomain.com', 'First Last');
    $mail-&gt;AddReplyTo('name@yourdomain.com', 'First Last');
    $mail-&gt;Subject = 'PHPMailer Test Subject via mail(), advanced';
    $mail-&gt;AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
    $mail-&gt;MsgHTML(file_get_contents('contents.html'));
    $mail-&gt;AddAttachment('images/phpmailer.gif');      // attachment
    $mail-&gt;AddAttachment('images/phpmailer_mini.gif'); // attachment
    $mail-&gt;Send();
    echo "Message Sent OK\n";
  } catch (phpmailerException $e) {
    echo $e-&gt;errorMessage(); //Pretty error messages from PHPMailer
  } catch (Exception $e) {
    echo $e-&gt;getMessage(); //Boring error messages from anything else!
  }
  
  ?&gt;
  </code></pre>
  
  <p>but i could n't find class.phpmailer.php file for this line -> require_once('../class.phpmailer.php');  from dowloaded file.</p>
  
  <p>did i miss something?</p>
  
  <p>would u plz help me for that?</p>
  
  <p>best regards.</p>