예제 #1
0
 /**
  * Constructeur de la classe
  *
  * @param void
  * @return void
  */
 public function __construct()
 {
     //Create a new PHPMailer instance
     $this->mail = new PHPMailer();
     //Tell PHPMailer to use SMTP
     $this->mail->IsSMTP();
     //Enable SMTP debugging
     // 0 = off (for production use)
     // 1 = client messages
     // 2 = client and server messages
     $this->mail->SMTPDebug = 0;
     //Ask for HTML-friendly debug output
     $this->mail->Debugoutput = 'html';
     //Set the hostname of the mail server
     $this->mail->Host = 'smtp.gmail.com';
     //Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
     $this->mail->Port = 25;
     //Set the encryption system to use - ssl (deprecated) or tls
     $this->mail->SMTPSecure = 'tls';
     //Whether to use SMTP authentication
     $this->mail->SMTPAuth = true;
     //Username to use for SMTP authentication - use full email address for gmail
     $this->mail->Username = '******';
     //Password to use for SMTP authentication
     $this->mail->Password = '******';
     //Set who the message is to be sent from
     $this->mail->SetFrom('*****@*****.**', 'A.F.T.A');
     //Set an alternative reply-to address
     $this->mail->AddReplyTo('*****@*****.**', 'A.F.T.A');
 }