[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cron/ -> send_mail.php (source)

   1  <?php
   2  ////////////////////////////////////////////////////
   3  // PHPMailer - PHP email class
   4  //
   5  // Class for sending email using either
   6  // sendmail, PHP mail(), or SMTP.  Methods are
   7  // based upon the standard AspEmail(tm) classes.
   8  //
   9  // Copyright (C) 2001 - 2003  Brent R. Matzelle
  10  //
  11  // License: LGPL, see LICENSE
  12  ////////////////////////////////////////////////////
  13  
  14  /**
  15   * PHPMailer - PHP email transport class
  16   * @package PHPMailer
  17   * @author Brent R. Matzelle
  18   * @copyright 2001 - 2003 Brent R. Matzelle
  19   */
  20  
  21  
  22  //file modified by richie
  23  
  24  
  25  require ("class.smtp.php");
  26  require ("class.phpmailer.php");
  27  
  28  function sendmail($to,$from,$subject,$contents,$mail_server,$mail_server_username,$mail_server_password,$filename)
  29  {
  30    $mail = new PHPMailer();
  31    $mail->Subject = $subject;
  32      $mail->Body    = $contents;//"This is the HTML message body <b>in bold!</b>";
  33  
  34      $initialfrom = $from;
  35  
  36      $mail->IsSMTP();                                      // set mailer to use SMTP
  37      //$mail->Host = "smtp1.example.com;smtp2.example.com";  // specify main and backup server
  38      $mail->Host = $mail_server;  // specify main and backup server
  39      $mail->SMTPAuth = true;     // turn on SMTP authentication
  40      $mail->Username = $mail_server_username ;//$smtp_username;  // SMTP username
  41      $mail->Password = $mail_server_password ;//$smtp_password; // SMTP password
  42      $mail->From = $from;
  43      $mail->FromName = $initialfrom;
  44      $mail->AddAddress($to);                  // name is optional
  45      $mail->AddReplyTo($from);
  46      $mail->WordWrap = 50;                                 // set word wrap to 50 characters
  47      $mail->IsHTML(true);                                  // set email format to HTML
  48      
  49      $mail->AltBody = "This is the body in plain text for non-HTML mail clients";
  50  
  51      if(!$mail->Send()) 
  52      {
  53         echo "Message could not be sent. <p>";
  54         echo "Mailer Error: " . $mail->ErrorInfo;
  55         exit;
  56      }
  57  
  58  }
  59  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7