本文整理汇总了PHP中phpmailer类的典型用法代码示例。如果您正苦于以下问题:PHP phpmailer类的具体用法?PHP phpmailer怎么用?PHP phpmailer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了phpmailer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: activateUser
/**
* Activate a given user.
* @param $id Identifier of user.
* @param $activationKey Activation key for user.
*/
function activateUser($id, $activationKey)
{
if (!empty($id) && !empty($activationKey)) {
global $dbi;
global $lActivate;
$result = $dbi->query("SELECT username,activationKey FROM " . userTableName . " WHERE id=" . $dbi->quote($id));
if ($result->rows()) {
list($username, $activationKeyDB) = $result->fetchrow_array();
if ($activationKey == $activationKeyDB) {
$dbi->query("UPDATE " . userTableName . " SET registered=registered,lastUpdated=lastUpdated,lastLogged=lastLogged,activated=1,activationKey='' WHERE id=" . $dbi->quote($id));
// Send confirmation email
$result = $dbi->query("SELECT name,email FROM " . userDataTableName . " WHERE id=" . $dbi->quote($id));
if ($result->rows()) {
list($name, $email) = $result->fetchrow_array();
// Send activation email
$mail = new phpmailer();
$mail->CharSet = "UTF-8";
$mail->Sender = pageAdminMail;
$mail->From = pageAdminMail;
$mail->FromName = pageTitle;
$mail->Subject = $lActivate["MailSubject"];
$mail->Body = sprintf($lActivate["MailMessage"], $name, $username);
$mail->IsHTML(false);
$mail->AddAddress($email);
$mail->Send();
}
echo '<p>' . $lActivate["HeaderText"] . '</p>';
} else {
echo '<p>' . $lActivate["HeaderTextError"] . '</p>';
}
}
}
}
开发者ID:gkathir15,项目名称:catmis,代码行数:38,代码来源:Login.class.php
示例2: f_SEND
function f_SEND($t_email = '', $t_asunto = '', $t_contenido)
{
require_once '../modelo/phpmailer/class.phpmailer.php';
$a_email = new phpmailer();
$a_email->Mailer = "smtp";
$a_email->Host = "";
$a_email->SMTPAuth = true;
$a_email->Port = '465';
$a_email->CharSet = 'utf8';
$a_email->Username = '';
$a_email->Password = '';
$a_email->From = '';
$a_email->FromName = '' . utf8_decode('');
//escribir la el contenido del correo
//dirección destino
$a_correo = '' . $t_email;
$a_email->addAddress($a_correo);
$a_email->Subject = '' . utf8_decode('' . $t_asunto);
$a_email->AddEmbeddedImage('../imagenes/inen_header.png', 'logoinen', 'inen_header.png');
$a_email->IsHTML(true);
$a_email->Body = "<p><img src=\"cid:logoinen\" /></p><p>" . utf8_decode('' . $t_contenido) . "</p>";
$a_email->AltBody = ' ';
if ($a_email->send()) {
echo "</br>Mensaje enviado correctamente.</br>";
} else {
echo "<br/><strong>Información:</strong><br/>" . $a_email->ErrorInfo;
}
}
开发者ID:kruben84ec,项目名称:izel,代码行数:28,代码来源:cc_CORREO.php
示例3: send
/**
* Send mail, similar to PHP's mail
*
* A true return value does not automatically mean that the user received the
* email successfully. It just only means that the method used was able to
* process the request without any errors.
*
* The default content type is 'text/plain' which does not allow using HTML.
*/
public static function send($from_email, $from_name, array $to, $subject, $message, array $cc = array(), array $bcc = array(), array $attachments = array())
{
$mailer = new phpmailer();
$content_type = 'text/plain';
$mailer->ContentType = $content_type;
$mailer->Hostname = \lib\conf\constants::$domain;
$mailer->IsMail();
$mailer->IsHTML(false);
$mailer->From = $from_email;
$mailer->FromName = $from_name;
// add recipients
foreach ((array) $to as $recipient_name => $recipient_email) {
$mailer->AddAddress(trim($recipient_email), trim($recipient_name));
}
// Add any CC and BCC recipients
foreach ($cc as $recipient_name => $recipient_email) {
$mailer->AddCc(trim($recipient_email), trim($recipient_name));
}
foreach ($bcc as $recipient_name => $recipient_email) {
$mailer->AddBcc(trim($recipient_email), trim($recipient_name));
}
// Set mail's subject and body
$mailer->Subject = $subject;
$mailer->Body = $message;
foreach ($attachments as $attachment) {
$mailer->AddAttachment($attachment);
}
// Send!
$result = $mailer->Send();
return $result;
}
开发者ID:revcozmo,项目名称:dating,代码行数:40,代码来源:mail.php
示例4: __construct
function __construct()
{
$mail = new phpmailer();
$mail->IsSMTP();
//$mail->IsMail();
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->SMTPSecure = "ssl";
// sets the prefix to the servier
$mail->Host = SMTP_HOST;
// sets GMAIL as the SMTP server
$mail->Port = SMTP_PORT;
// set the SMTP port for the GMAIL server
$mail->Username = SMTP_USERNAME;
// GMAIL username
$mail->Password = SMTP_PASSWORD;
// GMAIL password
$mail->AddReplyTo(EMAIL_FROM, "");
$mail->From = EMAIL_FROM;
$mail->FromName = EMAIL_FROM_NAME;
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
// optional, comment out and test
$mail->WordWrap = 50;
// set word wrap
$this->_mail = $mail;
}
开发者ID:business-expert,项目名称:prnsc,代码行数:26,代码来源:email.php
示例5: proc_upd
public function proc_upd()
{
$obj = ormPages::get(system::POST('obj_id'));
$obj->tabuList('pseudo_url', 'h1', 'keywords', 'title', 'description', 'active', 'is_home_page', 'view_in_menu', 'view_submenu', 'in_search', 'in_index', 'in_new_window', 'other_link', 'img_act', 'img_no_act', 'img_h1');
$obj->loadFromPost();
// Публикация на сайте
if (system::POST('publ', isBool)) {
if ($obj->isInheritor('faq') && $obj->newVal('answer') == '') {
ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), lang::get('FEEDBACK_MSG_3'));
ui::selectErrorFields(array('select' => '', 'focus' => 'answer'));
} else {
$obj->active = 1;
}
}
$obj_id = $obj->save();
// Если объект не сохранился, выводим пользователю текст ошибки.
if ($obj_id === false) {
system::savePostToSession();
ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), $obj->getErrorListText());
ui::selectErrorFields($obj->getErrorFields());
system::redirect('/feedback/message_upd/' . $_POST['obj_id']);
}
if (system::POST('send_to_email', isBool) && !$obj->send_answer_to_user && ($form_obj = ormObjects::get($obj->form_id))) {
if ($form_obj->send_answer) {
if ($obj->answer != '') {
$fields = $obj->getClass()->loadFields();
while (list($num, $field) = each($fields)) {
if (!empty($field['f_sname'])) {
page::assign($field['f_sname'], $obj->__get($field['f_sname']));
}
}
page::assign('site_name', domains::curDomain()->getSiteName());
page::assign('base_email', domains::curDomain()->getEmail());
$mail = new phpmailer();
$mail->From = $this->parse($form_obj->answer_sender_address);
$mail->FromName = $this->parse($form_obj->answer_sender_name);
$mail->AddAddress($obj->email);
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = $this->parse($form_obj->answer_subject);
$mail->Body = $this->parse($form_obj->answer_template);
$mail->Send();
// Помечаем, что ответ отправлен
$obj->send_answer_to_user = 1;
$obj->save();
ui::MessageBox(lang::get('FEEDBACK_MSG_1'), '');
} else {
ui::MessageBox(lang::get('TEXT_MESSAGE_ERROR'), lang::get('FEEDBACK_MSG_2'));
ui::selectErrorFields(array('select' => '', 'focus' => 'answer'));
}
}
}
// Если данные изменились корректно перенаправляем на соответствующию страницу
if ($_POST['parram'] == 'apply') {
system::redirect('/feedback/message_upd/' . $obj_id);
} else {
system::redirect('/feedback');
}
}
开发者ID:sunfun,项目名称:Bagira.CMS,代码行数:59,代码来源:__message.php
示例6: sendQRmail
function sendQRmail($from, $to, $subject, $msg, $qrcodeImage, $cid, $name)
{
include_once 'inc/class.phpmailer.php';
$mail = new phpmailer();
$mail->SMTPDebug = 0;
// debugging: 1 = errors and messages, 2 = messages only, 0 = off
$mail->IsSMTP();
// Set mailer to use SMTP
$mail->Host = 'mailhub.eait.uq.edu.au';
// Specify server
$mail->Port = 25;
// Server port: 465 ssl OR 587 tls
//$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
$mail->SMTPAuth = false;
// Enable SMTP authentication
$mail->Username = '[email protected]';
// SMTP username
$mail->Password = 'hongzhe123999';
// SMTP password
$mail->SetFrom($from, 'QRappi');
// Sender
$mail->AddReplyTo($from, 'Support');
// Set an alternative reply-to address
$mail->AddAddress($to, 'User');
// Set who the message is to be sent to
$mail->Subject = $subject;
// Set the subject line
// Prepares message for html (see doc for details http://phpmailer.worxware.com/?pg=tutorial)
$mail->MsgHTML($msg);
// Add the image to the email as an inline element (i.e. not as an attachment)
$mail->AddStringEmbeddedImage($qrcodeImage, $cid, $name);
// Send the message, check for errors
$ok = $mail->Send();
return $ok;
}
开发者ID:Hongzhe,项目名称:DECO3801-PeerTech,代码行数:35,代码来源:mail.php
示例7: autosend
* @param string mailto address
* @param string mail content
* @param array word replace rules
*
*/
public static function autosend($mailto, $content, $replace = null)
{
foreach ($replace as $k => $v) {
$content = str_replace($k, $v, $content);
}
$to = array();
if (is_string($mailto)) {
$to[0] = $mailto;
}
assert(trim($mailto) == '');
Mail::_send($to, $content);
}
/**
* Basic send function.
* @param array mailto list
* @param string content
* @param array attachment path list
*/
private static function _send($mailto, $content, $title = '', $attachment = null)
{
require_once 'phpmailer/class.phpmailer.php';
#echo "Begin!<br/>";
if ($title == '') {
$title = '来自IBM Power大赛官方的自动邮件,请勿直接回复本邮件。';
}
$mail = new phpmailer();
// defaults to using php "mail()"
$mail->IsSmtp();
// telling the class to use SendMail transport
#$body = 'hello cxj!<br/>';
#$body = eregi_replace("[\]",'',$body);
$config = C('PHPMAILER');
$address = $config['FROM'];
$password = $config['PASSWORD'];
$smtp = $config['HOST'];
$port = $config['PORT'];
#$mail->AddReplyTo($address,"First Last");
foreach ($mailto as $m) {
$mail->AddAddress($m, "Power大赛参赛选手 {$m} ");
}
$mail->SMTPAuth = true;
//$mail->from = $address;
//$mail->to = $address;
$mail->smtpsecure = 'ssl';
$mail->From = $address;
开发者ID:sysuzjz,项目名称:soya,代码行数:50,代码来源:Mail.class.php
示例8: a2b_mail
function a2b_mail($to, $subject, $mail_content, $from = 'root@localhost', $fromname = '', $contenttype = 'multipart/alternative')
{
$mail = new phpmailer();
$mail->From = $from;
$mail->FromName = $fromname;
//$mail -> IsSendmail();
//$mail -> IsSMTP();
$mail->Subject = $subject;
$mail->Body = nl2br($mail_content);
//$HTML;
$mail->AltBody = $mail_content;
// Plain text body (for mail clients that cannot read HTML)
// if ContentType = multipart/alternative -> HTML will be send
$mail->ContentType = $contenttype;
$mail->AddAddress($to);
$mail->Send();
}
开发者ID:sayemk,项目名称:a2billing,代码行数:17,代码来源:Misc.inc.php
示例9: sendmail
function sendmail($subject, $mailcontent, $receiver, $receivername, $attachment = "")
{
if (strpos($_SERVER['HTTP_HOST'], "localhost")) {
return false;
}
$mail = new phpmailer();
$mail->IsSMTP();
$mail->Host = "mail.pepool.com";
$mail->Port = 2525;
$mail->SMTPAuth = true;
$mail->Username = "info+pepool.com";
// Write SMTP username in ""
$mail->Password = "*VTWqNzPNKlut";
$mail->Mailer = "smtp";
$mail->IsHTML(true);
$mail->ClearAddresses();
$mail->From = "[email protected]";
$mail->FromName = "pepool";
$mail->Subject = $subject;
$mail->Body = $mailcontent;
$mail->AddAddress($receiver, $receivername);
if ($attachment != '') {
$mail->AddAttachment($attachment);
}
$suc = $mail->Send();
return $suc > 0;
}
开发者ID:gauravstomar,项目名称:Pepool,代码行数:27,代码来源:Mail.php
示例10: sendList
function sendList($list)
{
// send email of message
global $loader, $intl, $conf;
$loader->import('saf.Ext.phpmailer');
$mail = new phpmailer();
$mail->IsMail();
$mail->IsHTML(true);
foreach ($list as $item) {
if (strtoupper($item->type) == 'TASK') {
$id = 'T' . $item->id;
} elseif (strtoupper($item->type) == 'MESSAGE') {
$id = 'M' . $item->id;
} else {
$id = strtoupper(substr($item->type, 0, 1)) . $item->id;
}
$mail->From = $conf['Messaging']['return_address'];
//$mail->Subject = '[' . $this->id . '] ' . $this->subject;
//$mail->Body = $this->body;
$mail->AddAddress($item->address);
if (defined('WORKSPACE_' . strtoupper($item->type) . '_' . strtoupper($this->name) . '_SUBJECT')) {
$mail->Subject = $intl->get(constant('WORKSPACE_' . strtoupper($item->type) . '_' . strtoupper($this->name) . '_SUBJECT'), $item->struct);
} else {
$mail->Subject = '[' . $id . '] ' . $item->subject;
}
if (defined('WORKSPACE_' . strtoupper($item->type) . '_' . strtoupper($this->name) . '_BODY')) {
$mail->Body = $intl->get(constant('WORKSPACE_' . strtoupper($item->type) . '_' . strtoupper($this->name) . '_BODY'), $item->struct);
} else {
$mail->Body = $item->body;
}
if ($item->priority == 'urgent' || $item->priority == 'high') {
$mail->Priority = 1;
} else {
$mail->Priority = 3;
}
if (!$mail->Send()) {
$this->error = $mail->ErrorInfo;
return false;
}
$mail->ClearAddresses();
$mail->ClearAttachments();
}
return true;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:44,代码来源:Email.php
示例11: sendEmail
protected function sendEmail($to, $subject, $body)
{
include_once '../../libraries/phpmailer/class.phpmailer.php';
if (empty($to)) {
return false;
}
$mail = new phpmailer();
$mail->PluginDir = '../../libraries/phpmailer';
$mail->CharSet = 'UTF-8';
$mail->Subject = substr(stripslashes($subject), 0, 900);
$mail->From = '[email protected]';
$mail->FromName = 'ARIS Mailer';
$mail->AddAddress($to, 'ARIS Author');
$mail->MsgHTML($body);
$mail->WordWrap = 79;
if ($mail->Send()) {
return true;
} else {
return false;
}
}
开发者ID:kimblemj,项目名称:server,代码行数:21,代码来源:utils.php
示例12: send_mail
function send_mail($email, $date, $time)
{
require '../phpmailer/PHPMailerAutoload.php';
$mail = new phpmailer();
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'Kisamymum96';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('[email protected]', 'Mailer');
$mail->addAddress('' . $email . '', 'user');
$mail->isHTML(true);
$mail->Subject = 'booking';
$mail->Body = 'This email is coming from global styling to: ' . $email . ' </br>
your booking is set for ' . $date . ' at ' . $time . '
thank you for booking with us. Global Styling';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if (!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent to your E-Mail address';
}
}
开发者ID:sulemartin87,项目名称:assignment,代码行数:26,代码来源:success_booking.php
示例13: send
function send($newsletter_id)
{
global $db;
$owpDBTable = owpDBGetTables();
$send_mail = new phpmailer();
$send_mail->From = OWP_EMAIL_ADDRESS;
$send_mail->FromName = OWP_NAME;
$send_mail->Subject = $this->title;
$sql = "SELECT admin_gender, admin_firstname, admin_lastname,\n admin_email_address \n FROM " . $owpDBTable['administrators'] . " \n WHERE admin_newsletter = '1'";
$mail_values = $db->Execute($sql);
while ($mail = $mail_values->fields) {
$send_mail->Body = $this->content;
$send_mail->AddAddress($mail['admin_email_address'], $mail['admin_firstname'] . ' ' . $mail['admin_lastname']);
$send_mail->Send();
// Clear all addresses and attachments for next loop
$send_mail->ClearAddresses();
$send_mail->ClearAttachments();
$mail_values->MoveNext();
}
$today = date("Y-m-d H:i:s");
$db->Execute("UPDATE " . $owpDBTable['newsletters'] . " \n SET date_sent = " . $db->DBTimeStamp($today) . ",\n status = '1' \n WHERE newsletters_id = '" . owpDBInput($newsletter_id) . "'");
}
开发者ID:BackupTheBerlios,项目名称:osiswebprinter,代码行数:22,代码来源:newsletter.php
示例14: send
function send()
{
// send email of message
global $loader, $intl, $conf;
$loader->import('saf.Ext.phpmailer');
$mail = new phpmailer();
$mail->IsMail();
if (strtoupper($this->type) == 'TASK') {
$this->id = 'T' . $this->id;
} elseif (strtoupper($this->type) == 'MESSAGE') {
$this->id = 'M' . $this->id;
} else {
$this->id = strtoupper(substr($this->type, 0, 1)) . $this->id;
}
$mail->From = $conf['Messaging']['return_address'];
if (defined('WORKSPACE_' . strtoupper($this->type) . '_' . strtoupper($this->name) . '_SUBJECT')) {
$mail->Subject = $intl->get(constant('WORKSPACE_' . strtoupper($this->type) . '_' . strtoupper($this->name) . '_SUBJECT'), $this);
} else {
$mail->Subject = '[' . $this->id . '] ' . $intl->get('Notice');
}
if (defined('WORKSPACE_' . strtoupper($this->type) . '_' . strtoupper($this->name) . '_BODY')) {
$mail->Body = $intl->get(constant('WORKSPACE_' . strtoupper($this->type) . '_' . strtoupper($this->name) . '_BODY'), $this);
} else {
$mail->Body = $this->subject;
}
// message body should be less than $this->charlimit characters
$mail->Body = substr($mail->Body, 0, $this->charlimit);
$mail->AddAddress($this->address);
if ($this->priority == 'urgent' || $this->priority == 'high') {
$mail->Priority = 1;
}
if ($mail->Send()) {
return true;
}
$this->error = $mail->ErrorInfo;
return false;
}
开发者ID:vojtajina,项目名称:sitellite,代码行数:37,代码来源:SMS.php
示例15: send_email
function send_email($content)
{
require "PHPMailer/class.phpmailer.php";
//Instanciamos un objeto de la clase phpmailer
$mail = new phpmailer();
//Indicamos a la clase phpmailer donde se encuentra la clase smtp
//$mail->PluginDir = "";
//Indicamos que vamos a conectar por smtp
$mail->Mailer = "smtp";
$mail->CharSet = "UTF-8";
//Nuestro servidor smtp. Como ves usamos cifrado ssl
$mail->Host = "ssl://smtp.gmail.com";
//Puerto de gmail 465
$mail->Port = "465";
//Le indicamos que el servidor smtp requiere autenticación
$mail->SMTPAuth = true;
//Le decimos cual es nuestro nombre de usuario y password
$mail->Username = "[email protected]";
$mail->Password = "Thlink0013";
//Indicamos cual es nuestra dirección de correo y el nombre que
//queremos que vea el usuario que lee nuestro correo
$mail->From = "[email protected]";
$mail->FromName = "Nuevo registro en iNBest";
//El valor por defecto de Timeout es 10, le voy a dar un poco mas
$mail->Timeout = 30;
//Indicamos cual es la dirección de destino del correo.
$mail->AddAddress("[email protected]");
//$mail->AddCC("[email protected]");
//Asignamos asunto
$mail->Subject = "Nuevo Registro a través del sitio de iNBest - Solicita más Información";
//Cuerpo del mensaje. Puede contener html
$mail->Body = $content;
//Si no admite html
$mail->AltBody = "Cuerpo de mensaje solo texto";
//Envia en email
$resultado = $mail->Send();
}
开发者ID:sylverman,项目名称:inbest,代码行数:37,代码来源:procesar.php
示例16: forgotPassword
function forgotPassword(&$Model, $email)
{
$user = $Model->find("User.email = '" . $email . "'");
if ($user) {
$id = $user['User']['id'];
$mail = new phpmailer();
$mail->AddAddress($user['User']['email'], $user['User']['username']);
$mail->FromName = Configure::read('SparkPlug.administrator.from_name');
$mail->From = Configure::read('SparkPlug.administrator.email');
$mail->Subject = 'Password Reset';
$password = $user['User']['password'];
$salt = Configure::read("Security.salt");
$activate_key = md5($password . $salt);
$link = Router::url("/users/activate_password?ident={$id}&activate={$activate_key}", true);
$mail->Body = "Dear " . $user['User']['username'] . ",\n\nKindly click the link below:\n" . $link . "\n\t\nThen set your password.\n\nRegards,\nSite Admin";
if ($Model->useDbConfig != 'test_suite') {
$mail->Send();
}
$Model->lastResetPassword = array('id' => $id, 'password' => $password);
return true;
} else {
return false;
}
}
开发者ID:jedt,项目名称:spark_plug,代码行数:24,代码来源:membership.php
示例17: sendmail
public function sendmail($from, $to, $subject, $body, $altbody = null, $options = null, $attachments = null, $html = false)
{
if (!is_array($from)) {
$from = array($from, $from);
}
$mail = new phpmailer();
$mail->PluginDir = 'M/lib/phpmailer/';
if ($this->getConfig('smtp')) {
$mail->isSMTP();
$mail->Host = $this->getConfig('smtphost');
if ($this->getConfig('smtpusername')) {
$mail->SMTPAuth = true;
$mail->Port = $this->getConfig('smtpport') ? $this->getConfig('smtpport') : 25;
$mail->SMTPDebug = $this->smtpdebug;
$mail->Username = $this->getConfig('smtpusername');
$mail->Password = $this->getConfig('smtppassword');
}
}
$mail->CharSet = $this->getConfig('encoding');
$mail->AddAddress($to);
$mail->Subject = $subject;
$mail->Body = $note . $body;
$mail->AltBody = $altbody;
if (!is_array($from)) {
$from = array($from, $from);
}
$mail->From = $from[0];
$mail->FromName = $from[1];
if (key_exists('reply-to', $options)) {
$mail->AddReplyTo($options['reply-to']);
unset($options['reply-to']);
}
if (key_exists('Sender', $options)) {
$mail->Sender = $options['Sender'];
}
if (null != $attachments) {
if (!is_array($attachments)) {
$attachments = array($attachments);
}
foreach ($attachments as $k => $v) {
if (!$mail->AddAttachment($v, basename($v))) {
trigger_error("Attachment {$v} could not be added");
}
}
}
$mail->IsHTML($html);
$result = $mail->send();
}
开发者ID:demental,项目名称:m,代码行数:48,代码来源:Phpmailer.php
示例18: SendMail
function SendMail($email, $name, $subject, $message)
{
global $sockethost, $smtpauth, $smtpauthuser, $smtpauthpass, $socketfrom, $socketfromname, $socketreply, $socketreplyname;
include 'class.phpmailer.php';
$mail = new phpmailer();
$mail->IsSMTP();
$mail->Host = $sockethost;
if ($smtpauth == 'TRUE') {
$mail->SMTPAuth = true;
$mail->Username = $smtpauthuser;
$mail->Password = $smtpauthpass;
}
if (isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
$mail->From = $email;
$mail->FromName = $name;
$mail->AddReplyTo($email, $name);
} else {
$mail->From = $socketfrom;
$mail->FromName = $socketfromname;
$mail->AddReplyTo($socketreply, $socketreplyname);
}
$mail->IsHTML(False);
$mail->Body = $message;
$mail->Subject = $subject;
if (isset($_GET['caseid']) && ($_GET['caseid'] == 'NewTicket' || $_GET['caseid'] == 'view')) {
$mail->AddAddress($socketfrom, $socketfromname);
} else {
$mail->AddAddress($email, $name);
}
if (!$mail->Send()) {
return 'Error: ' . $mail->ErrorInfo;
} else {
return 'Email Sent.';
}
$mail->ClearAddresses();
}
开发者ID:paintballrefjosh,项目名称:php-nuke-support-ticket,代码行数:36,代码来源:functions.php
示例19: fu_envia_clave
function fu_envia_clave($nom, $email, $email_ins, $user, $clave, $tipo)
{
require_once "class.phpmailer.php";
$mail = new phpmailer();
$mail->From = "[email protected]";
$mail->FromName = "Oficina Asesora de Sistemas";
$mail->Host = "mail.udistrital.edu.co";
$mail->Mailer = "smtp";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "capitaloas2011";
$mail->Timeout = 120;
$mail->Charset = "utf-8";
$mail->IsHTML(false);
if ($tipo == 4) {
$tip = "Coordinador";
} elseif ($tipo == 16) {
$tip = "Decano";
} elseif ($tipo == 24) {
$tip = "Funcionario";
} elseif ($tipo == 26) {
$tip = "Proveedor";
} elseif ($tipo == 30) {
$tip = "Docente";
} elseif ($tipo == 51) {
$tip = "Estudiante";
}
//echo "tipo en fua_ ".$tipo; exit;
$fecha = date("d-M-Y h:i:s A");
$comen = "Mensaje generado automáticamente por el servidor de la Oficina Asesora de Sistemas.\n";
$comen .= "Este es su usuario y clave para ingresar al Sistema de Información Cóndor.\n\n";
$comen .= "Por seguridad cambie la clave.\n\n";
$sujeto = "Clave";
$cuerpo = "Fecha de envio: " . $fecha . "\n\n";
$cuerpo .= "Señor(a) : " . $nom . "\n\n";
$cuerpo .= $comen . "\n\n";
$cuerpo .= "Tipo: " . $tip . "\n";
$cuerpo .= "Usuario: " . $user . "\n";
$cuerpo .= "Clave Acceso: " . $clave . "\n";
$mail->Body = $cuerpo;
$mail->Subject = $sujeto;
$mail->AddAddress($email);
$mail->AddCC($email_ins);
if (!$mail->Send()) {
header("Location: {$redir}?error_login=16");
} else {
header("Location: {$redir}?error_login=18");
}
$mail->ClearAllRecipients();
}
开发者ID:udistrital,项目名称:PROVEEDORES_DES,代码行数:50,代码来源:fu_envia_clave_aut.php
示例20: enviar
function enviar($arguntos)
{
# code...
$mail = new phpmailer(true);
// the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP();
// telling the class to use SMTP
$mail->Host = Host;
// SMTP server
$mail->SMTPDebug = 0;
// enables SMTP debug information (for testing)
$mail->IsHTML(true);
$mail->SMTPAuth = SMTPAuth;
// enable SMTP authentication
$mail->SMTPSecure = SMTPSecure;
// sets the prefix to the servier
$mail->Port = Port;
// set the SMTP port for the GMAIL server
$mail->Username = Username;
// GMAIL username
$mail->Password = Password;
// GMAIL password
$mail->AddAddress($arguntos['email'], $arguntos['nomebusca']);
if (AddReplyTo != '') {
$mail->AddReplyTo(AddReplyTo);
}
$mail->Subject = $arguntos['Subject'];
$mail->From = SetFromEmail;
$mail->FromName = SetFromNome;
$mail->Body = $arguntos['conteudo'];
// optional - MsgHTML will create an alternate automatically
// $mail->MsgHTML($arguntos['conteudo']);
if ($mail->Send()) {
echo "<p>Mensagem enviada com Sucesso!!!!</p>\n";
}
}
开发者ID:tvieira,项目名称:homebank,代码行数:36,代码来源:old_enviaemail.php
注:本文中的phpmailer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论