O Resultado da importação do arquivo foi:<br><br> Quantidade de liberados para faturamento: ' . $cont_liberado . '<br> Mensagens de erro: ' . $cont_erro . '<br> <ul>' . $mail_mensagem . '</ul><br><br> Att,<br> Equipe Cartório Postal<br> '; //** you can still specify custom headers as long as you use the constant //** 'EmailNewLine' to separate multiple headers. $CustomHeaders = ''; //** create the new email message. All constructor parameters are optional and //** can be set later using the appropriate property. $message = new Email($Recipiant, $Sender, $Subject, $CustomHeaders); $message->Cc = $Cc; $message->Bcc = $Bcc; // $text=$row[5]; // $html=$row[5]; //$content=$content; $message->SetHtmlContent($html); $pathToServerFile = "attachments/{$at['1']}/{$at['2']}"; //** attach this very PHP script. $serverFileMimeType = 'multipart/mixed'; //** this PHP file is plain text. //** attach the given file to be sent with this message. ANy number of //** attachments can be associated with an email message. //** NOTE: If the file path does not exist or cannot be read by PHP the file //** will not be sent with the email message. $message->Send(); echo '<h1><a href="pedido.php">Clique aqui para voltar</a></h1></div>'; require 'footer.php';
<?php require_once "../includes/maladireta/config.inc.php"; require_once "../includes/maladireta/class.Email.php"; $pedidoDAO = new PedidoDAO(); $pedidos = $pedidoDAO->listaAtrasados(date('Y-m-d'), date('Y-m-d')); $pedidos_email = array(); foreach ($pedidos as $p) { $pedidos_email[$p->id_usuario][] = $p; } foreach ($pedidos_email as $id_usuario => $pedidos) { $mensagem = '<h1>Atraso de pedidos</h1>'; $mensagem .= '<ul>'; foreach ($pedidos as $p) { $mensagem .= '<li>' . $p->id_pedido . "/" . $p->ordem . '</li>'; } $mensagem .= '</ul><br><br>Essa é uma mensagem automática e não precisa ser respondida'; $message = new Email($p->email, "Cartório Postal <*****@*****.**>", "Atraso de Pedidos", ''); $message->SetHtmlContent($mensagem); $pathToServerFile = "attachments/{$at['1']}/{$at['2']}"; //** attach this very PHP script. $message->Send(); } echo '<br>Comunicados de atraso enviados com sucesso!<br>';
<?php ini_set('max_execution_time', '0'); require "../model/Database.php"; require "../includes/funcoes.php"; require "../includes/global.inc.php"; $financeiroDAO = new FinanceiroDAO(); $financeiroDAO->replaceFinanceiroFin(); require_once "../includes/maladireta/class.Email.php"; $message = new Email('*****@*****.**', '*****@*****.**', 'Teste', $CustomHeaders); $message->Cc = ''; $message->SetHtmlContent('Fim com Sucesso'); $message->Send(); echo '<pre>Fim</pre>';
echo "\n" . $e->id_empresa . " => " . $e->fantasia . " \t::\t "; $pedidos = $pedidoDAO->listarConfirmacaoPendente($e->id_empresa); $funcionarios = $usuarioDAO->listarPorDepartamentoEmpresa($e->id_empresa, 2, true); if (count($pedidos) > 0) { $to2 = ''; $subject = 'pedidos cancelados em ' . date("d/m/Y"); $body = '<h3>' . $subject . '</h3>'; $body .= '<ul>'; foreach ($pedidos as $pedido) { $body .= '<li>' . $pedido->id_pedido . ' / ' . $pedido->ordem . ' </li>'; $p->status = 'cancelado'; print_r($p); $pedidoAlertaDAO->inserir($p); // $pedidoDAO->cancelaAutomaticamente($p); } $body .= '</ul>'; echo count($pedidos); foreach ($funcionarios as $i => $f) { $to2 .= $i != 0 ? ',' . $f->email : $f->email; } $from = $to = '*****@*****.**'; $message = new Email($to, $from, $subject, ''); $message->SetHtmlContent($body); if ($message->Send()) { echo ' email enviado!'; } else { echo ' erro ao enviar o email !'; } } } echo '</pre>';
$message->Bcc = $Bcc; $message->SetHtmlContent($html . '<br><br>' . $email_franquia); $pathToServerFile = "attachments/{$at['1']}/{$at['2']}"; //** attach this very PHP script. $serverFileMimeType = 'multipart/mixed'; //** this PHP file is plain text. //** attach the given file to be sent with this message. ANy number of //** attachments can be associated with an email message. //** NOTE: If the file path does not exist or cannot be read by PHP the file //** will not be sent with the email message. $message->Send(); $Recipiant = '*****@*****.**'; $message = new Email($Recipiant, $Sender, $Subject, $CustomHeaders); $message->Cc = $Cc; $message->Bcc = $Bcc; $message->SetHtmlContent($html . '<br><br>' . $email_franquia); $pathToServerFile = "attachments/{$at['1']}/{$at['2']}"; //** attach this very PHP script. $serverFileMimeType = 'multipart/mixed'; //** this PHP file is plain text. //** attach the given file to be sent with this message. ANy number of //** attachments can be associated with an email message. //** NOTE: If the file path does not exist or cannot be read by PHP the file //** will not be sent with the email message. $message->Send(); $done = 1; } else { echo $erro; } } if ($errors) {
$Bcc = ''; $Subject = replaceExtraParams($mysql, $table_prefix, "{$defaultname}", $row[4], $r[0]); $CustomHeaders = ''; //** create the new email message. All constructor parameters are optional and //** can be set later using the appropriate property. $message = new Email($Recipiant, $Sender, $Subject, $CustomHeaders); $message->Cc = $Cc; $message->Bcc = $Bcc; if ($row[8] == "1") { $final_str = $disp_str . $final_str; $alt_content = $row[17]; $alt_content = str_replace("{UNSUBSCRIBE-LINK}", $lnk, $alt_content); $alt_content = str_replace("{EMAIL}", $toemail, $alt_content); $alt_content = replaceExtraParams($mysql, $table_prefix, "{$defaultname}", $alt_content, $r[0]); $message->SetTextContent($alt_content); $message->SetHtmlContent($final_str); } else { $message->SetTextContent($final_str); } if ($smtpmailer == 1 && $flag_var == 1) { $mail = new PHPMailer(true); //$mail->SMTPDebug = 2; // enables SMTP debug information (for testing) $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = $smtp_host; // specify SMTP mail server $mail->Port = $smtp_port; // specify SMTP Port $mail->SMTPAuth = $smtp_auth; // turn on SMTP authentication $mail->Username = $smtp_user;