function createMail($mail, $pass, $to, $subject, $body) { $obj = new PHPmailer(); $obj->IsSMTP(); $obj->IsHTML(true); //Configuração SMTP $user = $mail; $alias = ''; if (is_array($mail)) { $user = $mail[0]; $alias = $mail[1]; } configSmtpServer($obj, $user); $obj->Username = $user; $obj->Password = $pass; //Destinatários $obj->From = $user; $obj->SetFrom = $user; $obj->FromName = $alias; $obj->AddAddress($to); //Corpo $obj->Subject = $subject; $obj->Body = $body; return $obj; }
function envoyerEmail($subject, $body, $nameFrom, $mailFrom, $tabMailTo) { require_once "../../phpmailer/PHPMailerAutoload.php"; $mail = new PHPmailer(); $mail->SetLanguage("en", "../include/lib/phpmailer/language/"); $mail->IsSMTP(true); $mail->IsHTML(true); $mail->Host = MAILSERVER; $mail->CharSet = "UTF-8"; $name = PROJECT; $mailFrom = $mailFrom; $mail->From = $mailFrom; $mail->FromName = $nameFrom; foreach ($tabMailTo as $mailTo) { $mail->AddAddress($mailTo); } // SUJET ET MESSAGE $mail->Subject = $subject; $mail->Body = $body; // ENVOIE if (!$mail->Send()) { displayAndLog("ECHEC de l'envoie vers " . $mailTo . " ERREUR : " . $mail->ErrorInfo, LOG_LEVEL_ERROR); } else { displayAndLog("Envoi reussie vers " . $mailTo, LOG_LEVEL_NORMAL); } $mail->SmtpClose(); unset($mail); }
private static function mailjetMail($reply, $to, $objet, $content, $attachments) { require_once ROOT . 'phpmailer/class.phpmailer.php'; $mail = new PHPmailer(); $mail->CharSet = CHARSET; $mail->IsSMTP(); $mail->Host = "in.mailjet.com"; $mail->SMTPAuth = true; // Si votre serveur requiert une authentification. $mail->SMTPSecure = 'ssl'; $mail->Port = 25; $mail->Username = "******"; $mail->Password = "******"; $mail->IsHTML(true); $mail->From = $reply; $mail->FromName = 'Route des Vins de bordeaux, graves et sauternes'; $mail->AddAddress($to); // recepteur $mail->AddReplyTo($reply); $mail->Subject = $objet; $mail->Body = $content; foreach ($attachments as $cid => $attachment) { $mail->AddEmbeddedImage($attachment['file'], $cid, $attachment['name']); } if (!$mail->Send()) { print_r($mail->ErrorInfo); } }
function enviamail($mail_orig, $login, $password) { require '../mail/class.phpmailer.php'; $email = (string) $mail_orig; $mail = new PHPmailer(); $mail->IsSMTP(); $mail->IsHTML(true); $mail->Helo = 'mail.pw-jre.heliohost.org'; $mail->SMTPSecure = 'SSL'; $mail->Username = '******'; $mail->Password = '******'; $mail->Host = 'mail.pw-jre.heliohost.org'; $mail->From = '*****@*****.**'; $mail->SetFrom = '*****@*****.**'; $mail->AddAddress($email); #$mail->AddReplyTo('*****@*****.**', 'Administrator JO2012'); $mail->Subject = 'Palavra Passe JO2012'; $mail->Body = '<html><body><head><style>.tabela{border:solid 3px;font-size:25px;text-align:center;}</style></head>'; $mail->Body .= '<center><table><tr><img src="http://img703.imageshack.us/img703/4474/headermail.jpg"</td></tr>'; $mail->Body .= '<tr><td>Login de acesso ao site: ' . $login . ' </td></tr>'; $mail->Body .= '<tr><td>Palavra Passe: ' . $password . '</td></tr></table></center></body></html>'; if (!$mail->Send()) { #return $mail->ErrorInfo; $erro = true; #return 'Verifica o email introduzido (ex: meumail@mail.com)'; return $erro; } else { $erro = false; #return 'Email enviado com sucesso'; return $erro; } $mail->SmtpClose(); unset($mail); }
function mail_to_all_user($receivename, $receivermail, $fromname, $fromemail, $mailbody, $subject) { echo 'asdas'; $mail = new PHPmailer(); //object of mailer function $mail->isHTML(true); $name = $receivename; $emails_to = $receivermail; $mail->FromName = $fromname; $mail->From = $fromemail; $mail->AddAddress($emails_to, $receivename); $mail->Subject = $subject; $mail->Body = $mailbody; $mail->WordWrap = 50; if (!$mail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; return true; } else { return false; } }
function sendMail($subject, $content, $address = '') { $mailer = new PHPmailer(); $mailer->Host = 'mail.lianjia.com'; $mailer->IsSMTP(); $mailer->SMTPAuth = true; // 链家邮件发件人设置 $mailer->Username = "******"; $mailer->Password = '******'; $mailer->From = "*****@*****.**"; $mailer->FromName = "API日志分析"; $mailer->CharSet = "UTF-8"; // 收件人设置 $mailer->Encoding = "base64"; $mailer->AddAddress('*****@*****.**'); $mailer->AddAddress('*****@*****.**'); if ($address) { foreach ((array) $address as $tmp) { $mailer->AddAddress($tmp); } } // $mailer->AddCC('*****@*****.**'); // $filename = $subject.".html"; // $file = fopen($filename, "w+"); // fwrite($file, $content); // fclose($file); // 文件太大,采取压缩后附件形式 // shell_exec("tar zcvf $filename.tar $filename "); // shell_exec("zip -r $filename.zip $filename "); $mailer->IsHTML(true); $mailer->Subject = $subject; $mailer->Body = $content; // $tarName = $filename.'.zip'; // $mailer->AddAttachment('./'.$tarName, "$tarName");//附件的路径和附件名称 if ($mailer->Send()) { echo "send email {$subject} successful!"; } else { echo "sendmail wrong" . $mailer->ErrorInfo; } // shell_exec("rm $tarName"); // shell_exec("rm $filename"); }
<!-- document.location.replace("' . $www . '"); // --> </script>'; } else { if ($_GET['ldap'] == "1") { include './core/ldap.php'; } else { if ($_GET['action'] == "reject") { $requser = mysql_query("SELECT * FROM `tusers` where id LIKE '{$_GET['id']}'"); $user_to_send_email = mysql_fetch_array($requser); $email_to_send = $user_to_send_email[mail]; $requete = "DELETE FROM tusers WHERE id = '{$_GET['id']}'"; $execution = mysql_query($requete) or die('Erreur SQL !<br /><br />' . mysql_error()); require "components/PHPMailer_v5.1/class.phpmailer.php"; $mail = new PHPmailer(); $mail->CharSet = 'UTF-8'; //UTF-8 possible if characters problems //$mail->IsMail(); $mail->IsSendmail(); $mail->IsHTML(true); // Envoi en html $mail->From = "{$rparameters['mail_from']}"; $mail->FromName = "{$rparameters['mail_from']}"; $mail->AddAddress($email_to_send); $mail->AddReplyTo("{$rparameters['mail_from']}"); $mail->Subject = "Compte rejeter"; $bodyMSG = "Bonjour , <br /><br />\r\n Votre compte a été supprimé par le système, nous reprenons contact avec vous dès que possible. <br /><br />\r\n Nous restons à votre disposition pour tout renseignement complémentaire. <br /><br />\r\n Bien à vous\r\n "; $mail->Body = utf8_encode("{$bodyMSG}"); $mail->Send(); $mail->ClearAddresses();
function enviamail_re_co($mail_orig, $tipo, $nome, $qtd, $designacao, $numero) { require '../mail/class.phpmailer.php'; $email = (string) $mail_orig; $mail = new PHPmailer(); $mail->IsSMTP(); $mail->IsHTML(true); $mail->Helo = 'mail.pw-jre.heliohost.org'; $mail->SMTPSecure = 'SSL'; $mail->Username = '******'; $mail->Password = '******'; $mail->Host = 'mail.pw-jre.heliohost.org'; $mail->From = '*****@*****.**'; $mail->SetFrom = '*****@*****.**'; $mail->AddAddress($email); #$mail->AddReplyTo('*****@*****.**', 'Administrator JO2012'); $mail->Subject = $tipo . ' com sucesso'; $mail->Body = '<html><body><head><style>.tabela{border:solid 3px;font-size:25px;text-align:center;}</style></head>'; $mail->Body .= '<center><table><tr><img src="http://pw-jre.heliohost.org/images/header_mail.jpg"</td></tr>'; $mail->Body .= '<tr><td>Caro ' . $nome . ',</td></tr>'; $mail->Body .= '<tr><td>Obrigado pela ' . $tipo . ' de ' . $qtd . ' lugares para : ' . $designacao . '</td></tr>'; $mail->Body .= '<tr><td>Numero da ' . $tipo . ': ' . $numero . '</td></tr></table></center></body></html>'; if (!$mail->Send()) { #return $mail->ErrorInfo; $mail->SmtpClose(); unset($mail); $erro = true; #return 'Verifica o email introduzido (ex: meumail@mail.com)'; return $erro; } else { $erro = false; $mail->SmtpClose(); unset($mail); #return 'Email enviado com sucesso'; return $erro; } #$mail->SmtpClose(); #unset($mail); }
if (!filter_var($sender_email, FILTER_VALIDATE_EMAIL)) { $message = "Please ensure that you have provided a valid e-mail address!"; header("Location:contact_result.php?message={$message}&success=0"); exit; } //To guard against e-mail injection and spamming. foreach ($_POST as $value) { if (stripos($value, 'Content-Type:') !== FALSE or $_POST['spam_honeypot'] != '') { $message = "I'm sorry, but there was a problem with your input."; header("Location:contact_result.php?message={$message}&success=0"); exit; } } $email_body = "Name: " . $sender_name . "\n" . "E-mail: " . $sender_email . "\n" . "Message: " . $sender_message; //Send the e-mail. $mail = new PHPmailer(); //$mail->SMTPDebug = 3; $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->SMTPSecure = 'tls'; $mail->Host = "smtp.gmail.com"; $mail->Port = 587; $mail->Username = "******"; $mail->Password = "******"; $mail->From = $sender_email; $mail->FromName = $sender_name; $mail->Body = $email_body; $mail->addAddress("*****@*****.**"); $mail->Subject = "User Commentary"; //Maybe add a new input field to the contact form later? if (!$mail->send()) {
} if (isset($_POST['submit'])) { $password = $_POST['password']; $salt = substr(md5(uniqid(rand(), true)), 0, 5); // Generate a random key $_POST['password'] = md5($salt . md5($_POST['password'])); // store in md5, md5 password + salt $email = $_POST['email']; $query = mysql_query("SELECT mail FROM tusers where mail='{$email}'"); $r = mysql_fetch_array($query); if ($r['0'] == '') { $requete = "INSERT INTO tusers (profile, code, civility, firstname,lastname,password,salt,mail,phone,mobil,company,numero_rue, address1,zip,city,login,service, code_tva, note, disable, group_id) VALUES (1, '{$_POST['code']}','{$_POST['civilite']}', '{$_POST['firstname']}','{$_POST['lastname']}','{$_POST['password']}','{$salt}','{$_POST['email']}','{$_POST['fixe']}','{$_POST['mobile']}','{$_POST['company']}','{$_POST['rue']}','{$_POST['address1']}','{$_POST['zip']}','{$_POST['ville']}','{$_POST['email']}','{$_POST['service']}','{$_POST['tva']}','{$_POST['note']}', '0', NULL)"; $execution = mysql_query($requete) or die('Erreur SQL !<br /><br />' . mysql_error()); if ($execution) { require "components/PHPMailer_v5.1/class.phpmailer.php"; $mail = new PHPmailer(); $mail->CharSet = 'UTF-8'; //UTF-8 possible if characters problems $mail->IsSendmail(); $mail->IsHTML(true); // Envoi en html $mail->From = "{$rparameters['mail_from']}"; $mail->FromName = "{$rparameters['mail_from']}"; $mail->AddAddress($email); $mail->AddReplyTo("{$rparameters['mail_from']}"); $mail->Subject = "Nouvelle entrée dans le système."; $bodyMSG = "Bonjour , <br /><br />\r\n Nous vous remercions pour votre nouvelle demande dans le système.<br />\r\n Celle-ci sera prise en compte dans les prochaines heures.<br /><br />\r\n Voila votre nom d'utilisateur et mot de passe pour accéder à la plateforme <br />\r\n <b>Login </b> : {$_POST['email']}<br />\r\n <b>Mot de passe </b> : {$password} <br />"; $mail->Body = utf8_encode("{$bodyMSG}"); if (!$mail->Send()) { $msg = '<div id="erreur"><img src="./images/access.png" alt="erreur" style="border-style: none" alt="img" />'; $msg = $mail->ErrorInfo;
$query2 = "UPDATE Activate SET Activation_code = '{$code}' WHERE Numero = '{$num}';"; echo $query2; } else { $query1 = "INSERT INTO Users VALUES('{$nick}','{$num}','{$email}');"; echo $query1 . "<br>"; $query2 = "INSERT INTO Activate VALUES('{$num}','{$code}');"; echo $query2; } $query3 = "INSERT INTO Reg_ids VALUES('{$num}','{$reg}');"; echo $query3 . "<br>"; mysql_query($query1, $connessione) or die("Query1 fallita!" . mysql_error($connessione)); mysql_query($query2, $connessione) or die("Query2 fallita!" . mysql_error($connessione)); mysql_query($query3, $connessione) or die("Query3 fallita!" . mysql_error($connessione)); require "../PHPMailer/class.phpmailer.php"; //istanziamo la classe $messaggio = new PHPmailer(); $messaggio->IsSMTP(); $messaggio->SMTPDebug = 1; $messaggio->SMTPAuth = true; $messaggio->Host = 'smtp.gmail.com'; $messaggio->Port = 465; $messaggio->SMTPSecure = 'ssl'; $messaggio->Username = "******"; $messaggio->Password = "******"; //definiamo le intestazioni e il corpo del messaggio $messaggio->From = '*****@*****.**'; $messaggio->FromName = "Support Team CipChat"; $messaggio->AddAddress($email); $messaggio->AddReplyTo('*****@*****.**'); $messaggio->Subject = 'Attivazione CipChat'; $messaggio->Body = stripslashes("Codice di attivazione: {$code}");
<?php require "components/PHPMailer_v5.1/class.phpmailer.php"; $mail = new PHPmailer(); $mail->CharSet = 'UTF-8'; //UTF-8 possible if characters problems $mail->IsSendmail(); // $mail->Host = "owa.bersay-associes.com"; // $mail->SMTPAuth = true; // $mail->SMTPSecure = 'ssl'; // $mail->Port = 465; // $mail->Username = "******"; // $mail->Password = "******"; $mail->IsHTML(true); // Envoi en html $mail->From = "*****@*****.**"; $mail->FromName = utf8_decode("Bersay Associés"); $mail->AddAddress("*****@*****.**"); //$mail->AddReplyTo("$rparameters[mail_from]"); $mail->Subject = "Nouvelle entrée dans le système."; $bodyMSG = "Bonjour , <br /><br />\r\n Nous vous remercions pour votre nouvelle demande dans le système.<br />\r\n Celle-ci sera prise en compte dans les prochaines heures.<br /><br />\r\n Voila votre nom d'utilisateur et mot de passe pour accéder à la plateforme <br />"; $mail->Body = utf8_encode("{$bodyMSG}"); if (!$mail->Send()) { $msg = '<div id="erreur"><img src="./images/access.png" alt="erreur" style="border-style: none" alt="img" />'; $msg = $mail->ErrorInfo; $msg = '</div>'; } else { echo ' c bon'; }
ini_set('display_errors' , 1); // LOST PASSWORD ///////////////////////////////////////////////////// // require_once('/home/qcsasiac/public_html/_sysinc/database_api.php'); require_once("phpmailer/class.phpmailer.php"); if($_REQUEST['lostPassword'] == '1') { // echo "dans if _POST[email] = " . $_GET["email"]; $mail = new PHPmailer(); $mail->IsSMTP(true); $mail->IsHTML(true); $mail->Host = "127.0.0.1"; global $wpdb; // $sqlQuery = "select * from qcs_members where email = '*****@*****.**'"; // $tab = $wpdb->get_row($sqlQuery); $resetKey = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10); $sqlQuery = "UPDATE qcs_members SET resetkey = '" . $resetKey . "' WHERE email = '" . $_GET["email"] . "'"; $wpdb->query($sqlQuery); $link = "http://www.qcsasia.com/reset?email=" . $_GET["email"] . "&resetkey=" . $resetKey;
//Mail object for states $qobject = mysql_query("SELECT * FROM tstates WHERE id LIKE '{$globalrow['state']}'"); $robject = mysql_fetch_array($qobject); $objet = "{$robject['mail_object']} pour le ticket n°{$_GET['id']}: {$globalrow['title']}"; $destinataire = "{$userrow['mail']}"; $emetteur = "{$creatorrow['mail']}"; //interger link parameter if ($rparameters['mail_link'] == 1) { $link = ", ou suivez votre ticket sur ce lien: <a href=\"http://{$_SERVER['SERVER_NAME']}\">http://{$_SERVER['SERVER_NAME']}</a>"; } else { $link = "."; } $msg = "\r\n\t<html>\r\n\t\t<head>\r\n\t\t</head>\r\n\t\t<body>\r\n\t\t\t<font face=\"Arial\">\r\n\t\t\t\t<table width=\"820px\" cellspacing=\"0\" >\r\n\t\t\t\t\t<tr bgcolor=\"{$rparameters['mail_color_title']}\" >\r\n\t\t\t\t\t <th><br /><font size=\"4px\" color=\"FFFFFF\"> {$objet} </font><br /><br /></th>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr bgcolor=\"{$rparameters['mail_color_bg']}\" >\r\n\t\t\t\t\t <td>\r\n\t\t\t\t\t\t<br /><br />\r\n\t\t\t\t\t\t{$rparameters['mail_txt']}<br />\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t<table border=\"1\" bordercolor=\"0075A4\" cellspacing=\"0\" width=\\800px\">\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td><font color=\"{$rparameters['mail_color_text']}\"><b>Titre:</b></b> {$globalrow['title']}</font></td>\r\n\t\t\t\t\t\t\t\t<td><font color=\"{$rparameters['mail_color_text']}\"><b>Catégorie:</b></b> {$catrow['1']} - {$subcatrow['2']}</td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td width=\"400px\"><font color=\"{$rparameters['mail_color_text']}\"><b>Demandeur:</b></b> {$userrow['lastname']} {$userrow['firstname']}</font></td>\r\n\t\t\t\t\t\t\t\t<td width=\"400px\"><font color=\"{$rparameters['mail_color_text']}\"><b>Technicien en charge:</b> {$techrow['lastname']} {$techrow['firstname']}</font></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td><font color=\"{$rparameters['mail_color_text']}\"><b>Etat:</b> {$staterow['0']}</font></td>\r\n\t\t\t\t\t\t\t\t<td><font color=\"{$rparameters['mail_color_text']}\"><b>Date de la demande:</b> {$date_create}</font></td>\t\r\n\t\t\t\t\t\t\t</tr> \r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td colspan=\"2\"><font color=\"{$rparameters['mail_color_text']}\"><b>Description:</b><br /> {$description}</font></td>\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td colspan=\"2\"><font color=\"{$rparameters['mail_color_text']}\"><b>Résolution:</b><br /> {$resolution}</font></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t<td width=\"400px\"><font color=\"{$rparameters['mail_color_text']}\"><b>Date estimée de résolution:</b></b> {$date_hope}</font></td>\r\n\t\t\t\t\t\t\t\t<td width=\"400px\"><font color=\"{$rparameters['mail_color_text']}\"><b>Date de résolution:</b> {$date_res}</font></td>\r\n\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t<br /><br /><br /><br />\r\n\t\t\t\t\t\t<hr />\r\n\t\t\t\t\t\tPour toutes informations complémentaires sur votre ticket, vous pouvez joindre {$techrow['firstname']} {$techrow['lastname']} au {$techrow['phone']}\r\n\t\t\t\t\t\t{$link}\r\n\t\t\t\t\t\t<hr />\r\n\t\t\t\t\t </td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t</font>\r\n\t\t</body>\r\n\t</html>" . "\r\n"; if ($send == 1) { require "components/PHPMailer_v5.1/class.phpmailer.php"; $mail = new PHPmailer(); $mail->CharSet = 'UTF-8'; //UTF-8 possible if characters problems $mail->IsSendmail(); // $mail->Host = "$rparameters[mail_smtp]"; // $mail->SMTPAuth = $rparameters['mail_auth']; // if ($rparameters['mail_secure']=='465') $mail->SMTPSecure = 'ssl'; // if ($rparameters['mail_secure']=='587') $mail->SMTPSecure = 'tls'; // if ($rparameters['mail_secure']=='465') $mail->Port = 465; // if ($rparameters['mail_secure']=='587') $mail->Port = 587; $mail->Username = "******"; $mail->Password = "******"; $mail->IsHTML(true); // Envoi en html // add picture // $mail->AddEmbeddedImage("chemin_image", "non_image", "cid_image");
<?php /* Author: Flox Filename: /core/message.php Description: page to send mail Parameters: $from, $to, $message, $object call: newticket_u.php, Version: 1.0 creation date: 21/11/2012 Last update: 21/11/2012 */ // initialize variables require "components/PHPMailer_v5.1/class.phpmailer.php"; $mail = new PHPmailer(); $mail->CharSet = 'ISO-8859-1'; //UTF-8 possible if characters problems //$mail->IsSMTP(); $mail->IsSendmail(); //$mail->Host = "$rparameters[mail_smtp]"; //$mail->SMTPAuth = $rparameters['mail_auth']; //if ($rparameters['mail_secure']=='465') $mail->SMTPSecure = 'ssl'; //if ($rparameters['mail_secure']=='587') $mail->SMTPSecure = 'tls'; //if ($rparameters['mail_secure']=='465') $mail->Port = 465; //if ($rparameters['mail_secure']=='587') $mail->Port = 587; $mail->Username = "******"; $mail->Password = "******"; $mail->IsHTML(true); // Envoi en html $mail->From = "{$from}"; $mail->FromName = "{$from}";
function enviamail_re_co($mail_orig, $tipo, $nome, $qtd, $designacao, $numero) { require '../mail/class.phpmailer.php'; $email = (string) $mail_orig; $mail = new PHPmailer(); $mail->IsSMTP(); $mail->IsHTML(true); $mail->Helo = 'mail.pw-jre.heliohost.org'; $mail->SMTPSecure = 'SSL'; $mail->Username = '******'; $mail->Password = '******'; $mail->Host = 'mail.pw-jre.heliohost.org'; $mail->From = '*****@*****.**'; $mail->SetFrom = '*****@*****.**'; $mail->AddAddress($email); #$mail->AddReplyTo('*****@*****.**', 'Administrator JO2012'); $mail->Subject = $tipo . ' com sucesso'; $mail->Body = '<html><body><head><style>.estrutura{margin: auto; width: 406px; box-shadow: 0 0 15px; background-color:#FFFFF0;}.letra{font-family:Tahoma;}.letra2{font-family:Tahoma; font-size: 11px; text-align: center;}.risco{background-color: black; height: 2px;}.risco2{border:1px dashed;}</style></head>'; $mail->Body .= '<table class="estrutura"><tr><td><img src="http://pw-jre.heliohost.org/visitante/images/imagemcabecalhomail.jpg"/></td></tr><tr><td><div class="risco"></div></td></tr>'; $mail->Body .= '<tr><td class="letra">Caro ' . $nome . ',</td></tr>'; $mail->Body .= '<tr><td class="letra">Obrigado pela ' . $tipo . ' de ' . $qtd . ' lugares para : ' . $designacao . '</td></tr>'; $mail->Body .= '<tr><td class="letra">Numero da ' . $tipo . ': ' . $numero . '</td></tr>'; $mail->Body .= '<tr><td><div class="risco"></div></td></tr></table></body></html>'; if (!$mail->Send()) { #return $mail->ErrorInfo; $mail->SmtpClose(); unset($mail); $erro = true; #return 'Verifica o email introduzido (ex: meumail@mail.com)'; return $erro; } else { $erro = false; $mail->SmtpClose(); unset($mail); #return 'Email enviado com sucesso'; return $erro; } #$mail->SmtpClose(); #unset($mail); }
include_once 'dbconnect.php'; $name = mysql_real_escape_string($_POST['name']); $phone = mysql_real_escape_string($_POST['phone']); $email = mysql_real_escape_string($_POST['email']); $kemail = "*****@*****.**"; if (mysql_query("INSERT INTO registrations(name,phone,email) VALUES('{$name}','{$phone}','{$email}')")) { $kmail = new PHPmailer(); $kmail->From = '*****@*****.**'; $kmail->FromName = 'Dunimoneeeee registration vannu'; $kmail->Subject = 'Dunikuttaaa inna pidicho registration details'; $kmail->Body = $name . $phone . $email; $ktxt = 'Kelvineee registration vannu.'; $kmail->AltBody = $ktxt; $kmail->AddAddress("{$kemail}"); $kmail->Send(); $mail = new PHPmailer(); $mail->From = '*****@*****.**'; $mail->FromName = 'TocH Centenary Cup'; $mail->Subject = 'Registration Confirmed'; $mail->Body = ' <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <!-- NAME: 1 COLUMN - BANDED --> <!--[if gte mso 15]> <xml> <o:OfficeDocumentSettings> <o:AllowPNG/> <o:PixelsPerInch>96</o:PixelsPerInch> </o:OfficeDocumentSettings>
public function sendInvitation(Invite $invitation, Users $user, Profile $profile) { $this->from = $user->getMail(); $this->subject = "Vous êtes invité sur TIPKIN"; $this->content = ' <p>Bonjour, <br/><br/> ' . $profile->getFirstname() . " " . $profile->getLastname() . " vous invite à rejoindre sa communauté sur Tipkin :\n\t\t\t\t\t\t\t\t<br/><br/>\n\t\t\t\t\t\t\t\t<q>Si tu ne connais pas encore Tipkin, connecte-toi, et rejoints ma Tipkin-ship !<br/>\nEnsemble nous pourrons partager tous nos objets.\t\t\t\t\t\t\t\t<br />\n N'hésites plus et viens consulter mes annonces sur mon profil <a href='" . $this->serverName . "users/member/" . $profile->getUserId() . "'>" . $user->getUsername() . "</a><br/>\n " . $invitation->commentaire . "</q><br/><br/>\n\t\t\t\t\t\t\t\tRejoignez le mouvement de la consommation collaborative!<br />\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\tA tout de suite sur <a href=" . $this->serverName . ">TIPKIN</a> ! <br /><br/>Je possède. Tu empruntes. Nous partageons !\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\tL'équipe TIPKIN.</p>\n\t\t\t\t\t\t\t\t"; $email_error = FALSE; $invitation->explodeEmailsListe(); $this->replaceContentKeywords(); $mail = new PHPmailer(); // $mail->IsSMTP(); $mail->IsSendMail(); //$mail->SMTPDebug=true; //permet de voir les erreurs si ça ne fonctionne pas $mail->Host = ini_get('SMTP'); // Connexion au serveur SMTP $mail->Port = 25; //$mail->SMTPAuth = true; // Cette partie est optionnelle si le serveur SMTP n'a pas besoin d'authentification //$mail->Username = '******'; // mettre l'adresse email que founit l'hébergeur //$mail->Password = '******'; // le mot de passe pour se connecter à votre boite mail sur l'hébergeur $mail->IsHTML(true); // Permet d'écrire un mail en HTML (=> conversion des balises $mail->CharSet = 'UTF-8'; // évite d'avoir des caractères chinois :) $mail->From = '*****@*****.**'; // adresse mail du compte qui envoi $mail->AddReplyTo($this->from); $mail->FromName = "L'équipe TIPKIN"; // remplace le nom du destinateur lors de la lecture d'un email $mail->Subject = $this->subject; // l'entête = nom du sujet $mail->Body = $this->content; // le corps = le message en lui-même, codé en HTML si vous voulez //$adresses = explode(",", $this->to); $invitation->email_error = FALSE; $invitation->email_sent = FALSE; foreach ($invitation->getEmailsliste() as $email) { $mail->AddAddress($email); // adresse du destinataire, plusieurs adresses possibles en même temps ! $Syntaxe = '#^[\\w.-.+]+@[\\w.-]+\\.[a-zA-Z]{2,6}$#'; if (preg_match($Syntaxe, $email)) { $checkemail = true; } else { $checkemail = false; } /*$checkemail=FALSE; if(filter_var($email, FILTER_VALIDATE_EMAIL)){ $checkemail=TRUE; } */ if (!$mail->Send() || !$checkemail) { $_REQUEST['error'] = $mail->ErrorInfo; // affiche une erreur => pas toujours explicite $error_flag = TRUE; $invitation->email_error[] = $email; } else { $invitation->email_sent[] = $email; } $mail->ClearAddresses(); } $mail->SmtpClose(); unset($mail); // ferme la connexion smtp et désalloue la mémoire... return $email_error; }
<?php header("Access-Control-Allow-Origin: *"); require "phpmailer/class.phpmailer.php"; $path_parts = pathinfo($_FILES['userfile']['name']); $mail = new PHPmailer(); $mail->SMTPAuth = false; $mail->IsHTML(true); $mail->From = $_POST['from']; $mail->AddAddress($_POST['destinataire']); //$mail->AddAddress($_POST['from']); $mail->AddReplyTo($_POST['from']); error_log("from:" . $_POST['from']); if (isset($_FILES['userfile'])) { $mail->AddAttachment($_FILES['userfile']['tmp_name'], 'photo.' . substr($path_parts['extension'], 0, 3)); } $mail->Subject = "Message envoyé depuis l'application L'Autre Radio " . date('d/m/Y') . " à " . date('G:i'); $mail->Body = ' Bonjour, <p>Message envoyé le ' . date('d/m/Y') . ' à ' . date('G:i') . ' depuis l\'application L\'Autre Radio</p> <p>Informations de la personne :</p> <div><strong>Nom :</strong> ' . $_POST['nom'] . '</div> <div><strong>Email :</strong> ' . $_POST['mail'] . '</div> <div><strong>Mobile :</strong> ' . $_POST['mobile'] . '</div> <div><strong>Message :</strong> ' . $_POST['message'] . '</div>'; if (!$mail->Send()) { $messageError1 = $mail->ErrorInfo; } else { $messageError1 = 'Mail envoyé avec succès'; } unset($mail); error_log("retour:" . $messageError1);
function cpg_mail($to, $subject, $msg_body = '', $type = 'text/plain', $sender_name = '', $sender_email = '', $msg_body_plaintext = '') { global $CONFIG, $lang_charset, $HTML_SUBST; // makeshift plaintext if not set if (!$msg_body_plaintext) { $msg_body_plaintext = strip_tags($msg_body); } // Convert html entities back into normal form for display in non HTML formats $msg_body_plaintext = strtr($msg_body_plaintext, array_flip($HTML_SUBST)); $subject = strtr($subject, array_flip($HTML_SUBST)); // send mails to ALL admins - not bridged only if ($to == 'admin') { if (UDB_INTEGRATION == 'coppermine') { $to = array($CONFIG['gallery_admin_email']); $result = cpg_db_query("SELECT user_email FROM {$CONFIG['TABLE_USERS']} WHERE user_group = 1"); while ($row = mysql_fetch_assoc($result)) { if (!empty($row['user_email'])) { $to[] = $row['user_email']; } } $to = array_unique($to); } else { $to = array($CONFIG['gallery_admin_email']); } } else { $to = array($to); } if ($sender_name == '') { $sender_name = strtr($CONFIG['gallery_name'], array_flip($HTML_SUBST)); } if ($sender_email == '') { $sender_email = $CONFIG['gallery_admin_email']; } $charset = $CONFIG['charset'] == 'language file' ? $lang_charset : $CONFIG['charset']; /** * Code to send confirmation email starts * Create the mail object */ $mail = new PHPmailer(); // Set the mail configuration if ($CONFIG['smtp_host']) { $mail->IsSMTP(); $mail->Host = $CONFIG['smtp_host']; if ($CONFIG['smtp_username']) { $mail->SMTPAuth = true; $mail->Username = $CONFIG['smtp_username']; $mail->Password = $CONFIG['smtp_password']; } else { $mail->SMTPAuth = false; } } else { $mail->IsMail(); } $mail->IsHTML(true); foreach ($to as $email) { $mail->AddAddress($email); } $mail->From = $sender_email; $mail->FromName = $sender_name; $mail->Subject = $subject; $mail->Body = $msg_body; $mail->AltBody = $msg_body_plaintext; $mail->CharSet = $charset; if ($mail->Send()) { return 'Mail sent!'; } else { return $mail->ErrorInfo; } }
<?php session_start(); $ruta_raiz = ".."; if (!isset($_SESSION['dependencia']) or !isset($_SESSION['nivelus'])) { include "{$ruta_raiz}/rec_session.php"; } if (true) { include "{$ruta_raiz}/config.php"; include "{$ruta_raiz}/auxLib/PHPMailer/class.phpmailer.php"; $mailObj = new PHPmailer(true); $mailObj->IsSMTP(); // enable SMTP $mailObj->CharSet = ini_get('default_charset'); $mailObj->SMTPDebug = $SMTPDebug; // debugging: 1 = errors and messages, 2 = messages only $mailObj->SMTPAuth = $SMTPAuth; // authentication enabled $mailObj->SMTPSecure = $SMTPSecure; // secure transfer enabled REQUIRED for GMail $mailObj->Host = $Host; $mailObj->Port = $Port; $mailObj->Username = $Username; $mailObj->Password = $Password; $mailObj->From = $from; $mailObj->FromName = $from_name; } error_reporting(0); /* REALIZAR TRANSACCIONES * Este archivo realiza las transacciones de radicados en Orfeo. */
public function MailTransfer($mailSendAddress, $MailName, $code) { $mail = new PHPmailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->Host = "smtp.gmail.com"; $mail->Port = 465; $mail->Username = "******"; $mail->Password = "******"; $mail->SMTPSecure = 'ssl'; $mail->SetFrom('*****@*****.**', 'Mortuza'); $mail->Subject = "Confirmation message from New Main Zone "; $mail->AltBody = "Any message."; $mail->MsgHTML($code); $address = $mailSendAddress; $mail->AddAddress($address, $MailName); if (!$mail->Send()) { echo $mail->ErrorInfo; return 0; } else { return 1; } }
function mailpmb($to_nom = "", $to_mail, $obj = "", $corps = "", $from_name = "", $from_mail, $headers, $copie_CC = "", $copie_BCC = "", $faire_nl2br = 0, $pieces_jointes = array(), $reply_name = "", $reply_mail = "") { global $opac_mail_methode, $opac_mail_html_format, $opac_mail_adresse_from; global $charset; if (!is_array($pieces_jointes)) { $pieces_jointes = array(); } $param = explode(",", $opac_mail_methode); if (!$param) { $param = array(); } $mail = new PHPmailer(); $mail->CharSet = $charset; if ($copie_CC) { $destinataires_CC = explode(";", $copie_CC); } else { $destinataires_CC = array(); } if ($copie_BCC) { $destinataires_BCC = explode(";", $copie_BCC); } else { $destinataires_BCC = array(); } $destinataires = explode(";", $to_mail); switch ($param[0]) { case 'smtp': // $pmb_mail_methode = méthode, hote:port, auth, name, pass $mail->IsSMTP(); $mail->Host = $param[1]; if ($param[2]) { $mail->SMTPAuth = true; $mail->Username = $param[3]; $mail->Password = $param[4]; if ($param[5]) { $mail->SMTPSecure = $param[5]; } // pour traitement connexion SSL } break; default: case 'php': $mail->IsMail(); $to_nom = ""; break; } if ($opac_mail_html_format) { $mail->IsHTML(true); } if (trim($opac_mail_adresse_from)) { $tmp_array_email = explode(';', $opac_mail_adresse_from); $mail->From = $tmp_array_email[0]; if (isset($tmp_array_email[1])) { $mail->FromName = $tmp_array_email[1]; } } else { $mail->From = $from_mail; $mail->FromName = $from_name; } for ($i = 0; $i < count($destinataires); $i++) { $mail->AddAddress($destinataires[$i], $to_nom); } for ($i = 0; $i < count($destinataires_CC); $i++) { $mail->AddCC($destinataires_CC[$i]); } for ($i = 0; $i < count($destinataires_BCC); $i++) { $mail->AddBCC($destinataires_BCC[$i]); } if ($reply_mail && $reply_name) { $mail->AddReplyTo($reply_mail, $reply_name); } else { $mail->AddReplyTo($from_mail, $from_name); } $mail->Subject = $obj; if ($opac_mail_html_format) { if ($faire_nl2br) { $mail->Body = wordwrap(nl2br($corps), 70); } else { $mail->Body = wordwrap($corps, 70); } } else { $corps = str_replace("<hr />", PHP_EOL . "*******************************" . PHP_EOL, $corps); $corps = str_replace("<hr />", PHP_EOL . "*******************************" . PHP_EOL, $corps); $corps = str_replace("<br />", PHP_EOL, $corps); $corps = str_replace("<br />", PHP_EOL, $corps); $corps = str_replace(PHP_EOL . PHP_EOL . PHP_EOL, PHP_EOL . PHP_EOL, $corps); $corps = strip_tags($corps); $corps = html_entity_decode($corps, ENT_QUOTES, $charset); $mail->Body = wordwrap($corps, 70); } for ($i = 0; $i < count($pieces_jointes); $i++) { if ($pieces_jointes[$i]["contenu"] && $pieces_jointes[$i]["nomfichier"]) { $mail->AddStringAttachment($pieces_jointes[$i]["contenu"], $pieces_jointes[$i]["nomfichier"]); } } if (!$mail->Send()) { $retour = false; global $error_send_mail; $error_send_mail[] = $mail->ErrorInfo; // echo $mail->ErrorInfo."<br /><br /><br /><br />"; // echo $mail->Body ; } else { $retour = true; } if ($param[0] == 'smtp') { $mail->SmtpClose(); } unset($mail); return $retour; }
function cpg_mail($to, $subject, $msg_body = '', $type = 'text/plain', $sender_name = '', $sender_email = '', $msg_body_plaintext = '') { global $CONFIG, $LANG, $CF, $DBS; // makeshift plaintext if not set if (!$msg_body_plaintext) { $msg_body_plaintext = strip_tags($msg_body); } // Convert html entities back into normal form for display in non HTML formats $msg_body_plaintext = strtr($msg_body_plaintext, array_flip($CF->htmlSubst)); $subject = strtr($subject, array_flip($CF->htmlSubst)); // send mails to ALL admins - not bridged only if ($to == 'admin') { $to = array($CONFIG['gallery_admin_email']); $results = $DBS->sql_query("SELECT {$DBS->field['user_id']}, {$DBS->field['email']} FROM {$DBS->usertable} WHERE {$DBS->field['user_group']} = 1"); for ($i = 0; $i < mysql_numrows($results); $i++) { print mysql_result($results, $i, $DBS->field['user_id']); $to[$i + 1] = mysql_result($results, 0, $DBS->field['email']); } } else { $to = array($to); } $to = array_unique($to); if ($sender_name == '') { $sender_name = strtr($CONFIG['gallery_name'], array_flip($CF->htmlSubst)); } if ($sender_email == '') { $sender_email = $CONFIG['gallery_admin_email']; } $charset = $CONFIG['charset'] == 'language file' ? $LANG['charset'] : $CONFIG['charset']; /** * Code to send confirmation email starts * Create the mail object */ $mail = new PHPmailer(); // Set the mail configuration if ($CONFIG['smtp_host']) { $mail->IsSMTP(); $mail->Host = $CONFIG['smtp_host']; if ($CONFIG['smtp_username']) { $mail->SMTPAuth = true; $mail->Username = $CONFIG['smtp_username']; $mail->Password = $CONFIG['smtp_password']; } else { $mail->SMTPAuth = false; } } else { $mail->IsMail(); } $mail->IsHTML(true); foreach ($to as $email) { $mail->AddAddress($email); } $mail->From = $sender_email; $mail->FromName = $sender_name; $mail->Subject = $subject; $mail->Body = $msg_body; $mail->AltBody = $msg_body_plaintext; $mail->CharSet = $charset; if ($mail->Send()) { return 'Mail sent!'; } else { return $mail->ErrorInfo; } }
function mailstream_send($a, $message_id, $item, $user) { if (!$item['visible']) { return; } if (!$message_id) { return; } require_once dirname(__FILE__) . '/class.phpmailer.php'; require_once 'include/bbcode.php'; $attachments = array(); mailstream_do_images($a, $item, $attachments); $frommail = get_config('mailstream', 'frommail'); if ($frommail == "") { $frommail = '*****@*****.**'; } $address = get_pconfig($item['uid'], 'mailstream', 'address'); if (!$address) { $address = $user['email']; } $mail = new PHPmailer(); try { $mail->XMailer = 'Friendica Mailstream Plugin'; $mail->SetFrom($frommail, mailstream_sender($item)); $mail->AddAddress($address, $user['username']); $mail->MessageID = $message_id; $mail->Subject = mailstream_subject($item); if ($item['thr-parent'] != $item['uri']) { $mail->addCustomHeader('In-Reply-To: ' . mailstream_generate_id($a, $item['thr-parent'])); } $mail->addCustomHeader('X-Friendica-Mailstream-URI: ' . $item['uri']); $mail->addCustomHeader('X-Friendica-Mailstream-Plink: ' . $item['plink']); $encoding = 'base64'; foreach ($attachments as $url => $image) { $mail->AddStringEmbeddedImage($image['data'], $image['guid'], $image['filename'], $encoding, $image['type']); } $mail->IsHTML(true); $mail->CharSet = 'utf-8'; $template = get_markup_template('mail.tpl', 'addon/mailstream/'); $item['body'] = bbcode($item['body']); $item['url'] = $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $item['id']; $mail->Body = replace_macros($template, array('$upstream' => t('Upstream'), '$local' => t('Local'), '$item' => $item)); mailstream_html_wrap($mail->Body); if (!$mail->Send()) { throw new Exception($mail->ErrorInfo); } logger('mailstream_send sent message ' . $mail->MessageID . ' ' . $mail->Subject, LOGGER_DEBUG); } catch (phpmailerException $e) { logger('mailstream_send PHPMailer exception sending message ' . $message_id . ': ' . $e->errorMessage(), LOGGER_NORMAL); } catch (Exception $e) { logger('mailstream_send exception sending message ' . $message_id . ': ' . $e->getMessage(), LOGGER_NORMAL); } // In case of failure, still set the item to completed. Otherwise // we'll just try to send it over and over again and it'll fail // every time. q('UPDATE `mailstream_item` SET `completed` = now() WHERE `message-id` = "%s"', dbesc($message_id)); }
$fullname = $_POST["fullname"]; $email = $_POST["email"]; $subject = $_POST["subject"]; $message = $_POST["message"]; //test the value are POSTing okay echo "fullname: " . $fullname . "<br>"; echo "email: " . $email . "<br>"; echo "subject: " . $subject . "<br>"; echo "message: " . $message . "<br>"; /* checks that the email entered is valid, things go real bad if the email is incorrect */ if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { echo $email . " is an invalid email format"; die; } require 'phpmailer/PHPMailerAutoload.php'; $mail = new PHPmailer(); $mail->IsSMTP(); $mail->SMTPDebug = 2; $mail->Debugoutput = 'html'; $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->SMTPSecure = "tls"; $mail->Port = 587; $mail->Username = "******"; // GMAIL username $mail->Password = "******"; // GMAIL username $email_to = "*****@*****.**"; $name_to = "Mikoto"; $mail->AddAddress($email_to, $name_to); $mail->SetFrom($email, $fullname);
function enviamaildiary($text) { //require 'C:/xampp/htdocs/gr-guias/mail/class.phpmailer.php'; require $_SESSION['locate_file_phpmailer']; //$emaildest = (string)$dest; $mail = new PHPmailer(); $mail->IsSMTP(); $mail->IsHTML(true); //$mail->Helo='auth.ptasp.com'; $mail->Port = $_SESSION['port_envio_mail_send_daily']; $mail->Helo = $_SESSION['helo_envio_mail_send_daily']; //$mail->SMTPSecure='SSL'; $mail->Username = $_SESSION['login_mail_send_daily']; $mail->Password = $_SESSION['password_mail_send_daily']; //$mail->Host='auth.ptasp.com'; $mail->Host = $_SESSION['host_envio_mail_send_daily']; $mail->From = $_SESSION['from_mail_send_daily']; $mail->SetFrom = $_SESSION['setfrom_mail_send_daily']; //$mail->AddCC('*****@*****.**'); //$mail->AddCC('*****@*****.**'); //$mail->AddCC('*****@*****.**'); //$mail->AddCC('*****@*****.**'); //$mail->AddCC('*****@*****.**'); foreach ($_SESSION['add_cc_mail_send_daily'] as $db => $value) { $mail->AddCC($value); } #$mail->AddReplyTo('*****@*****.**', 'Administrator JO2012'); $mail->Subject = 'Reparações pendentes e estado sms'; $mail->Body = $text; if ($mail->Send()) { $mail->ErrorInfo; $mail->SmtpClose(); unset($mail); //$erro = true; #return 'Verifica o email introduzido (ex: meumail@mail.com)'; return false; } else { //$erro = false; $mail->SmtpClose(); unset($mail); #return 'Email enviado com sucesso'; return true; } #$mail->SmtpClose(); #unset($mail); }
/** * @param $content */ public function sendMail($content) { $mail = new PHPmailer(); $mail->isSMTP(); $mail->SMTPDebug = 1; $mail->CharSet = 'utf-8'; $mail->Host = 'smtp.163.com'; $mail->SMTPAuth = true; $mail->Username = '******'; $mail->Password = '******'; //$mail->SMTPSecure = false; $mail->Port = 25; $mail->From = '*****@*****.**'; $mail->FromName = '12306提醒'; $mail->addAddress('*****@*****.**'); $mail->isHTML(true); $mail->Subject = '居然还有票~'; $mail->Body = $content . '<br /><br /><br /><a href="https://kyfw.12306.cn/otn/lcxxcx/init">赶紧去12306抢票吧~</a>'; if (!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent'; } }