Ejemplo n.º 1
0
 /**
  * Send email
  *
  * Uses the new XoopsMultiMailer
  *
  * @param string $
  * @param string $
  * @param string $
  * @return boolean FALSE on error.
  */
 function sendMail($email, $subject, $body, $headers)
 {
     $subject = $this->encodeSubject($subject);
     $this->encodeBody($body);
     $this->multimailer->ClearAllRecipients();
     $this->multimailer->AddAddress($email);
     $this->multimailer->Subject = $subject;
     $this->multimailer->Body = $body;
     $this->multimailer->CharSet = $this->charSet;
     $this->multimailer->Encoding = $this->encoding;
     if (!empty($this->fromName)) {
         $this->multimailer->FromName = $this->encodeFromName($this->fromName);
     }
     if (!empty($this->fromEmail)) {
         $this->multimailer->Sender = $this->multimailer->From = $this->fromEmail;
     }
     $this->multimailer->ClearCustomHeaders();
     foreach ($this->headers as $header) {
         $this->multimailer->AddCustomHeader($header);
     }
     if (!$this->multimailer->Send()) {
         $this->errors[] = $this->multimailer->ErrorInfo;
         return false;
     }
     return true;
 }
Ejemplo n.º 2
0
 /**
  * Send email
  *
  * Uses the new XoopsMultiMailer
  *
  * @param	string
  * @param	string
  * @param	string
  * @return	boolean	FALSE on error.
  */
 function sendMail($email, $subject, $body, $headers)
 {
     $subject = $this->encodeSubject($subject);
     $this->encodeBody($body);
     $this->multimailer->ClearAllRecipients();
     $this->multimailer->AddAddress($email);
     $this->multimailer->Subject = $subject;
     $this->multimailer->Body = $body;
     $this->multimailer->CharSet = $this->charSet;
     $this->multimailer->Encoding = $this->encoding;
     $this->multimailer->FromName = $this->encodeFromName($GLOBALS['xoopsConfig']['sitename']);
     if (!$this->multimailer->Send()) {
         $this->errors[] = $this->multimailer->ErrorInfo;
         return FALSE;
     }
     return TRUE;
 }