Esempio n. 1
0
function send_email($to_email, $to_name, $theme, $text_text, $text_html = '')
{
    global $config;
    if (!$config['smtp_adress']) {
        output_message('alert', 'Set SMTP settings in config !');
        return false;
    }
    if (!$to_email) {
        output_message('alert', 'Field "to" is empty.');
        return false;
    }
    set_time_limit(300);
    require_once 'core/mail/smtp.php';
    $mail = new SMTP();
    $mail->Delivery('relay');
    $mail->Relay($config['smtp_adress'], $config['smtp_username'], $config['smtp_password']);
    $mail->From($config['site_email'], $config['base_href']);
    $mail->AddTo($to_email, $to_name);
    $mail->Text($text_text);
    if ($text_html) {
        $mail->Html($text_html);
    }
    $sent = $mail->Send($theme);
    return $sent;
}
Esempio n. 2
0
 public function sendMail($assunto, $mensagem, $email_para = null)
 {
     $dados_envio = $this->configuracoesGerais(array('email_destinatario', 'email_remetente_host', 'email_remetente', 'email_remetente_senha'));
     //DADOS SMTP
     if (!empty($dados_envio)) {
         $smtp = $dados_envio['Configuracao']['email_remetente_host'];
         $usuario = $dados_envio['Configuracao']['email_remetente'];
         $senha = $dados_envio['Configuracao']['email_remetente_senha'];
         if ($email_para == null) {
             $email_para = $dados_envio['Configuracao']['email_destinatario'];
         }
     } else {
         $smtp = "smtp.zoio.net.br";
         $usuario = "*****@*****.**";
         $senha = "zoio2010";
         if ($email_para == null) {
             $email_para = '*****@*****.**';
         }
     }
     $email_de = $usuario;
     require_once './smtp/smtp.php';
     $mail = new SMTP();
     $mail->Delivery('relay');
     $mail->Relay($smtp, $usuario, $senha, 587, 'login', false);
     //$mail->addheader('content-type', 'text/html; charset=utf-8');
     //$mail->addheader('content-type', 'text/html; charset=iso-8859-1');
     $mail->TimeOut(10);
     $mail->Priority('normal');
     $mail->From($email_de);
     $mail->AddTo($email_para);
     //$mail->AddBcc('*****@*****.**');
     $mail->Html($mensagem);
     if ($mail->Send($assunto)) {
         //echo '_SMTP+_Enviou para g......@zoio.net.br';
         return true;
     } else {
         //echo '_SMTP+_Não enviou e-mail';
         return false;
     }
 }
Esempio n. 3
0
function send_email($to_email, $to_name, $theme, $text_text, $text_html = '')
{
    global $MW;
    if (!(string) $MW->getConfig->generic->smtp_adress) {
        output_message('alert', 'Set SMTP settings in config !');
        return false;
    }
    if (!$to_email) {
        output_message('alert', 'Field "to" is empty.');
        return false;
    }
    set_time_limit(300);
    include 'core/mail/smtp.php';
    $mail = new SMTP();
    $mail->Delivery('relay');
    $mail->Relay((string) $MW->getConfig->generic->smtp_adress, (string) $MW->getConfig->generic->smtp_username, (string) $MW->getConfig->generic->smtp_password);
    $mail->From((string) $MW->getConfig->generic->site_email, (string) $MW->getConfig->generic->site_title);
    $mail->AddTo($to_email, $to_name);
    $mail->Text($text_text);
    if ($text_html) {
        $mail->Html($text_html);
    }
    $sent = $mail->Send($theme);
    return $sent;
}