function SendEmailByPlaces($plid, $title, $txt) { global $sqlcn; $sql = "SELECT userid AS uid, users.email AS email FROM places_users\n INNER JOIN users ON users.id = places_users.userid WHERE places_users.placesid ={$plid} AND users.email <> ''"; $result = $sqlcn->ExecuteSQL($sql); while ($row = mysqli_fetch_array($result)) { smtpmail($row['email'], $title, $txt); } }
function Send_mail_BP_userlist($randomid, $title, $txt) { global $cfg; $result = mysql_query("SELECT * FROM bp_userlist INNER JOIN users ON bp_userlist.userid=users.id WHERE bp_userlist.randomid='{$randomid}'", $cfg->base_id); if ($result != '') { while ($myrow = mysql_fetch_array($result)) { //echo "!!!$myrow[email], $title, $txt!!!"; smtpmail($myrow[email], $title, $txt); } } }
function create_inet_mail($to_user_name, $to_user_email, $subject_text, $msgbody_text, $from = '') { global $cfg, $board_config; // The sending mail address must be the sys_part_mail, otherwise some mail-provider won't send the mail. // Set default Sender-Mail, if non is set if (!$from) { $from = $cfg['sys_party_mail']; } // No special charachters in Username! $to_user_name = preg_replace('#[^a-zA-Z ]#', '', $to_user_name); // Do not send, when in intranet mode if (!$cfg['sys_internet']) { $this->error = t('Um Internet-Mails zu versenden, muss sich Lansuite im Internet-Modus befinden'); return false; } // Set Charset if ($cfg['mail_utf8']) { $CharsetStr = ' charset=utf-8'; } else { $CharsetStr = ''; $subject_text = utf8_decode($subject_text); $msgbody_text = utf8_decode($msgbody_text); } $this->inet_headers = "MIME-Version: 1.0\n"; $this->inet_headers .= "Content-type: text/plain;{$CharsetStr}\n"; $this->inet_headers .= "From: {$from}\n"; // Cut out double line breaks $msgbody_text = str_replace("\r", '', $msgbody_text); // SMTP-Mail if ($cfg["mail_use_smtp"]) { $board_config["smtp_host"] = $cfg["mail_smtp_host"]; $board_config["smtp_username"] = $cfg["mail_smtp_user"]; $board_config["smtp_password"] = $cfg["mail_smtp_pass"]; $board_config["board_email"] = $from; include_once "modules/mail/smtp.php"; if (smtpmail($to_user_email, $subject_text, $msgbody_text, $this->inet_headers)) { return true; } else { return false; } // PHP-Mail } else { if (@mail("{$to_user_name} <{$to_user_email}>", $subject_text, $msgbody_text, $this->inet_headers)) { return true; } else { return false; } } }
<?php include_once 'smtp-func.php'; //include smtp-func.php $recepient = "*****@*****.**"; //ваш email $sitename = "shof.gp-studio.ru"; //имя сайта $name = trim($_POST["name"]); //имя $phone = trim($_POST["phone"]); //телефон $email = trim($_POST["email"]); //email $message = "Имя: {$name} \nТелефон: {$phone} \nEmail: {$email}"; //\nEmail: $email // сообщение $pagetitle = "Новая заявка с сайта \"{$sitename}\""; //тема письма smtpmail($recepient, $pagetitle, $message, "Content-type: text/plain; charset=\"utf-8\"\n From: {$recepient}"); //отправка письма // автоответчик $autoanswer = "Заявка с сайта \"{$sitename}\""; $automessage = "Здравствуйте, вы оставили заявку. С вами свяжутся в ближайшее время.\n\nC ув. менеджер \"{$sitename}\""; smtpmail($email, $autoanswer, $automessage, "Content-type: text/plain; charset=\"utf-8\"\n From: {$recepient}");
function sendEMail($from, $to, $subject, $body) { $message = '<html><head><meta charset="utf-8"><title>' . $subject . '</title></head><body><p>' . $body . '</p></body></html>'; /* Для отправки HTML-почты вы можете установить шапку Content-type. */ $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $headers .= "From: " . SITE_NAME . " <" . $from . ">\r\n"; //mail($to,$subject,$message,$headers); smtpmail($to, $subject, $message, $headers); }
function send() { global $board_config, $lang, $phpEx, $phpbb_root_path, $db; // Escape all quotes, else the eval will fail. $this->msg = str_replace("'", "\\'", $this->msg); $this->msg = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', "' . \$\\1 . '", $this->msg); // Set vars reset($this->vars); while (list($key, $val) = each($this->vars)) { ${$key} = $val; } eval("\$this->msg = '{$this->msg}';"); // Clear vars reset($this->vars); while (list($key, $val) = each($this->vars)) { unset(${$key}); } // We now try and pull a subject from the email body ... if it exists, // do this here because the subject may contain a variable $drop_header = ''; $match = array(); if (preg_match('#^(Subject:(.*?))$#m', $this->msg, $match)) { $this->subject = trim($match[2]) != '' ? trim($match[2]) : ($this->subject != '' ? $this->subject : 'No Subject'); $drop_header .= '[\\r\\n]*?' . phpbb_preg_quote($match[1], '#'); } else { $this->subject = $this->subject != '' ? $this->subject : 'No Subject'; } if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match)) { $this->encoding = trim($match[2]) != '' ? trim($match[2]) : trim($lang['ENCODING']); $drop_header .= '[\\r\\n]*?' . phpbb_preg_quote($match[1], '#'); } else { $this->encoding = trim($lang['ENCODING']); } if ($drop_header != '') { $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); } $to = $this->addresses['to']; $cc = count($this->addresses['cc']) ? implode(', ', $this->addresses['cc']) : ''; $bcc = count($this->addresses['bcc']) ? implode(', ', $this->addresses['bcc']) : ''; // Build header $this->extra_headers = ($this->reply_to != '' ? "Reply-to: {$this->reply_to}\n" : '') . ($this->from != '' ? "From: {$this->from}\n" : "From: " . $board_config['board_email'] . "\n") . "Return-Path: " . $board_config['board_email'] . "\nMessage-ID: <" . md5(uniqid(time())) . "@" . $board_config['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\nX-Priority: 3\nX-MSMail-Priority: Normal\nX-Mailer: PHP\nX-MimeOLE: Produced By phpBB2\n" . $this->extra_headers . ($cc != '' ? "Cc: {$cc}\n" : '') . ($bcc != '' ? "Bcc: {$bcc}\n" : ''); // Send message ... removed $this->encode() from subject for time being if ($this->use_smtp) { if (!defined('SMTP_INCLUDED')) { include $phpbb_root_path . 'includes/smtp.' . $phpEx; } $result = smtpmail($to, $this->subject, $this->msg, $this->extra_headers); } else { $empty_to_header = $to == '' ? TRUE : FALSE; $to = $to == '' ? $board_config['sendmail_fix'] ? ' ' : 'Undisclosed-recipients:;' : $to; $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); if (!$result && !$board_config['sendmail_fix'] && $empty_to_header) { $to = ' '; $sql = "UPDATE " . CONFIG_TABLE . " \n\t\t\t\t\tSET config_value = '1'\n\t\t\t\t\tWHERE config_name = 'sendmail_fix'"; if (!$db->sql_query($sql)) { message_die(GENERAL_ERROR, 'Unable to update config table', '', __LINE__, __FILE__, $sql); } $board_config['sendmail_fix'] = 1; $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); } } // Did it work? if (!$result) { message_die(GENERAL_ERROR, 'Failed sending email :: ' . ($this->use_smtp ? 'SMTP' : 'PHP') . ' :: ' . $result, '', __LINE__, __FILE__); } return true; }
/** * * @global type $sqlcn * @global type $cfg * @param type $status */ function SetStatus($status) { global $sqlcn, $cfg; if ($this->status != $status) { $url = $cfg->urlsite; $sqlcn->ExecuteSQL("UPDATE bp_xml SET status='{$status}' WHERE id='{$this->id}'", $cfg->base_id) or die('Неверный запрос Tbp_xml.SetStatus: ' . mysqli_error($sqlcn->idsqlconnection)); $zz = new Tusers(); $zz->GetById($this->userid); smtpmail($zz->email, "Изменился статус БП!", "Внимание! Зайдите на портал и посмотрите статус БП№ {$this->id} <br><a href={$url}/index.php?content_page=bp>{$this->title}</a>"); } }
function send() { global $phpEx, $phpbb_root_dir; if (isset($phpbb_root_dir)) { // we must be in the admin section. $phpbb_root_path = $phpbb_root_dir; } else { $phpbb_root_path = "./"; } if ($this->address == NULL) { message_die(GENERAL_ERROR, "No email address set", "", __LINE__, __FILE__); } else { if (!$this->parse_email()) { return FALSE; } if ($this->use_smtp) { if (!defined('SMTP_INCLUDED')) { include $phpbb_root_path . "includes/smtp." . $phpEx; } if (!smtpmail($this->address, $this->subject, $this->msg, $this->extra_headers)) { message_die(GENERAL_ERROR, "Sending via SMTP failed", "", __LINE__, __FILE__); } } else { @mail($this->address, $this->subject, $this->msg, $this->extra_headers); } } return TRUE; }
/** * Process queue * Using lock file */ function process() { global $db, $config, $phpEx, $phpbb_root_path, $user; $lock = new \phpbb\lock\flock($this->cache_file); $lock->acquire(); // avoid races, check file existence once $have_cache_file = file_exists($this->cache_file); if (!$have_cache_file || $config['last_queue_run'] > time() - $config['queue_interval']) { if (!$have_cache_file) { set_config('last_queue_run', time(), true); } $lock->release(); return; } set_config('last_queue_run', time(), true); include $this->cache_file; foreach ($this->queue_data as $object => $data_ary) { @set_time_limit(0); if (!isset($data_ary['package_size'])) { $data_ary['package_size'] = 0; } $package_size = $data_ary['package_size']; $num_items = !$package_size || sizeof($data_ary['data']) < $package_size ? sizeof($data_ary['data']) : $package_size; /* * This code is commented out because it causes problems on some web hosts. * The core problem is rather restrictive email sending limits. * This code is nly useful if you have no such restrictions from the * web host and the package size setting is wrong. // If the amount of emails to be sent is way more than package_size than we need to increase it to prevent backlogs... if (sizeof($data_ary['data']) > $package_size * 2.5) { $num_items = sizeof($data_ary['data']); } */ switch ($object) { case 'email': // Delete the email queued objects if mailing is disabled if (!$config['email_enable']) { unset($this->queue_data['email']); continue 2; } break; case 'jabber': if (!$config['jab_enable']) { unset($this->queue_data['jabber']); continue 2; } include_once $phpbb_root_path . 'includes/functions_jabber.' . $phpEx; $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']); if (!$this->jabber->connect()) { $messenger = new messenger(); $messenger->error('JABBER', $user->lang['ERR_JAB_CONNECT']); continue 2; } if (!$this->jabber->login()) { $messenger = new messenger(); $messenger->error('JABBER', $user->lang['ERR_JAB_AUTH']); continue 2; } break; default: $lock->release(); return; } for ($i = 0; $i < $num_items; $i++) { // Make variables available... extract(array_shift($this->queue_data[$object]['data'])); switch ($object) { case 'email': $err_msg = ''; $to = !$to ? 'undisclosed-recipients:;' : $to; if ($config['smtp_delivery']) { $result = smtpmail($addresses, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $err_msg, $headers); } else { $result = phpbb_mail($to, $subject, $msg, $headers, $this->eol, $err_msg); } if (!$result) { $messenger = new messenger(); $messenger->error('EMAIL', $err_msg); continue 2; } break; case 'jabber': foreach ($addresses as $address) { if ($this->jabber->send_message($address, $msg, $subject) === false) { $messenger = new messenger(); $messenger->error('JABBER', $this->jabber->get_log()); continue 3; } } break; } } // No more data for this object? Unset it if (!sizeof($this->queue_data[$object]['data'])) { unset($this->queue_data[$object]); } // Post-object processing switch ($object) { case 'jabber': // Hang about a couple of secs to ensure the messages are // handled, then disconnect $this->jabber->disconnect(); break; } } if (!sizeof($this->queue_data)) { @unlink($this->cache_file); } else { if ($fp = @fopen($this->cache_file, 'wb')) { fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>"); fclose($fp); phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); } } $lock->release(); }
/** * Sends the mail. */ function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') { $to = $to_name != '' ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr; $from = $from_name != '' ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr; if (is_string($headers)) { $headers = explode($this->lf, trim($headers)); } for ($i = 0, $n = count($headers); $i < $n; $i++) { if (is_array($headers[$i])) { for ($j = 0, $nn = count($headers[$i]); $j < $nn; $j++) { if ($headers[$i][$j] != '') { $xtra_headers[] = $headers[$i][$j]; } } } if ($headers[$i] != '') { $xtra_headers[] = $headers[$i]; } } if (!isset($xtra_headers)) { $xtra_headers = array(); } //die(EMAIL_TRANSPORT); switch (EMAIL_TRANSPORT) { case 'smtp': $headers_list = 'From: ' . $from . $this->lf; $headers_list .= 'To: ' . $to . $this->lf; $headers_list .= implode($this->lf, $this->headers) . $this->lf; $headers_list .= implode($this->lf, $xtra_headers); if (EMAIL_FRIENDLY_ERRORS == 'true') { return @mail($to_addr, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list); } else { return mail($to_addr, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list); } break; case 'smtpauth': $tz = date("Z"); $tzs = $tz < 0 ? "-" : "+"; $tz = abs($tz); $tz = $tz / 3600 * 100 + $tz % 3600 / 60; $datum = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz); $headers_list = 'From: ' . $from . $this->lf; // $headers_list .= 'To: ' . $to . $this->lf; $headers_list .= "Reply-To: " . $from . $this->lf; $headers_list .= "Date: " . $datum . $this->lf; $headers_list .= implode($this->lf, $this->headers) . $this->lf; $headers_list .= implode($this->lf, $xtra_headers); return smtpmail($to_addr, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list); break; case 'sendmail-f': $headers_list = 'From: ' . $from . $this->lf; $headers_list .= implode($this->lf, $this->headers) . $this->lf; $headers_list .= implode($this->lf, $xtra_headers); if (EMAIL_FRIENDLY_ERRORS == 'true') { return @mail($to, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list, "-f" . $from); } else { return mail($to, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list, "-f" . $from); } break; case 'sendmail': default: $headers_list = 'From: ' . $from . $this->lf; $headers_list .= implode($this->lf, $this->headers) . $this->lf; $headers_list .= implode($this->lf, $xtra_headers); if (EMAIL_FRIENDLY_ERRORS == 'true') { return @mail($to, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list); } else { return mail($to, $subject, preg_replace("#(?<!\r)\n#s", "\r\n", $this->output), $headers_list); } break; } }
$f2 = @fopen($put_k_failu2, "rb"); $telo_pisma_fail = "------------" . $un . "\nContent-Type: " . $zag_type . "; Charset=UTF-8" . $end_zag; $telo_pisma_fail .= "Content-Transfer-Encoding: 8bit" . $end_zag . $end_zag . "{$telo_pisma}" . $end_zag; if (isset($put_k_failu)) { $telo_pisma_fail .= "------------" . $un . $end_zag; $telo_pisma_fail .= "Content-Type: application/octet-stream; name=\"" . basename($name_fail) . "\"" . $end_zag; $telo_pisma_fail .= "Content-Transfer-Encoding: base64" . $end_zag; $telo_pisma_fail .= "Content-Disposition: attachment; filename=\"" . basename($name_fail) . "\"" . $end_zag . $end_zag; $telo_pisma_fail .= chunk_split(base64_encode(fread($f, filesize($put_k_failu)))); } if (isset($put_k_failu2)) { $telo_pisma_fail .= $end_zag . "------------" . $un . $end_zag; $telo_pisma_fail .= "Content-Type: application/octet-stream; name=\"" . basename($name_fail2) . "\"" . $end_zag; $telo_pisma_fail .= "Content-Transfer-Encoding: base64\n"; $telo_pisma_fail .= "Content-Disposition: attachment; filename=\"" . basename($name_fail2) . "\"" . $end_zag . $end_zag; $telo_pisma_fail .= chunk_split(base64_encode(fread($f2, filesize($put_k_failu2)))); } $telo_pisma_fail .= "------------" . $un . "--"; $telo_pisma = $telo_pisma_fail; } if ($sposob_otp == "true") { $return = smtpmail($smtp_host, $smtp_port, $smtp_login, $smtp_passw, $email_polucha, $telo_pisma, $headers); } else { $return = mail($email_polucha, $tema_pisma, $telo_pisma, $headers); } if ($return == true) { echo "true"; } else { echo "false"; } }
function send($to) { global $use_smtp, $phpExt; if (!$use_smtp) { $result = @mail($to, $this->subject, ' ', $this->_build()); } else { if (!defined('SMTP_INCLUDED')) { include 'include/smtp.' . $phpExt; } $result = smtpmail($to, $this->subject, ' ', $this->_build()); } return $result; }
function smtpmassmail($mail_to, $subject, $message, $headers = '') { $mailaddresses = explode(",", $mail_to); foreach ($mailaddresses as $mailaddress) { smtpmail($mailaddress, $subject, $message, $headers); } }
} } if ($export_file !== '') { $vars = explode(',', $export_fields); $str_arr[] = '"' . date("d.m.y H:i:s") . '"'; foreach ($vars as $var_name) { if (isset($_POST[$var_name])) { $str_arr[] = '"' . $_POST[$var_name] . '"'; } } file_put_contents($export_file, implode(';', $str_arr) . "\n", FILE_APPEND | LOCK_EX); } smtpmail($email, $subject, $message . '<br>' . $fields); if ($client_email !== '') { $client_message === '' ? $message .= '<br>' . $fields : ($message = $client_message); smtpmail($_POST[$client_email], $subject, $message, true); } function smtpmail($to, $subject, $content, $client_mode = false) { global $success, $smtp, $host, $auth, $secure, $port, $username, $password, $from, $addreply, $charset, $cc, $bcc, $client_email, $client_message, $client_file; require_once './class-phpmailer.php'; $mail = new PHPMailer(true); if ($smtp) { $mail->IsSMTP(); } try { $mail->SMTPDebug = 0; $mail->Host = $host; $mail->SMTPAuth = $auth; $mail->SMTPSecure = $secure; $mail->Port = $port;
function process() { global $site_file_root, $config; set_config('last_queue_run', time(), true); // Delete stale lock file if (file_exists($this->cache_file . '.lock') && !file_exists($this->cache_file)) { @unlink($this->cache_file . '.lock'); return; } if (!file_exists($this->cache_file) || file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval']) { return; } $fp = @fopen($this->cache_file . '.lock', 'wb'); fclose($fp); include $this->cache_file; foreach ($this->queue_data as $object => $data_ary) { @set_time_limit(60); $package_size = $data_ary['package_size']; $num_items = sizeof($data_ary['data']) < $package_size ? sizeof($data_ary['data']) : $package_size; switch ($object) { case 'email': // Delete the email queued objects if mailing is disabled if (!$config['email_enable']) { unset($this->queue_data['email']); continue 2; } break; case 'jabber': if (!$config['jab_enable']) { unset($this->queue_data['jabber']); continue 2; } require_once $site_file_root . 'includes/forums/functions_jabber.php'; $this->jabber = new jabber(); $this->jabber->server = $config['jab_host']; $this->jabber->port = $config['jab_port'] ? $config['jab_port'] : 5222; $this->jabber->username = $config['jab_username']; $this->jabber->password = $config['jab_password']; $this->jabber->resource = $config['jab_resource'] ? $config['jab_resource'] : ''; if (!$this->jabber->connect()) { messenger::error('JABBER', 'Could not connect to Jabber server'); continue 2; } if (!$this->jabber->send_auth()) { messenger::error('JABBER', 'Could not authorise on Jabber server'); continue 2; } $this->jabber->send_presence(NULL, NULL, 'online'); break; default: return; } for ($i = 0; $i < $num_items; $i++) { extract(array_shift($this->queue_data[$object]['data'])); switch ($object) { case 'email': $err_msg = ''; $to = !$to ? 'Undisclosed-Recipient:;' : $to; $result = $config['smtp_delivery'] ? smtpmail($addresses, $subject, wordwrap($msg), $err_msg, $encoding, $headers) : @$config['email_function_name']($to, $subject, implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); if (!$result) { @unlink($this->cache_file . '.lock'); $message = 'Method: [ ' . ($config['smtp_delivery'] ? 'SMTP' : 'PHP') . ' ]<br /><br />' . $err_msg . '<br /><br /><u>CALLING PAGE</u><br /><br />' . (!empty($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']); messenger::error('MAIL', $message); continue 3; } break; case 'jabber': foreach ($addresses as $address) { $this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)); } break; } } // No more data for this object? Unset it if (!sizeof($this->queue_data[$object]['data'])) { unset($this->queue_data[$object]); } // Post-object processing switch ($object) { case 'jabber': // Hang about a couple of secs to ensure the messages are // handled, then disconnect sleep(1); $this->jabber->disconnect(); break; } } if (!sizeof($this->queue_data)) { @unlink($this->cache_file); } else { $file = '<?php $this->queue_data=' . $this->format_array($this->queue_data) . '; ?>'; if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); fwrite($fp, $file); @flock($fp, LOCK_UN); fclose($fp); } } @unlink($this->cache_file . '.lock'); }
function SendMail($frommail, $tomail, $subject, $message, $fromfullname = "laptrinhwebphp.com") { global $arrayConfig; $from = $fromfullname . " <" . $frommail . ">"; $headers = "Return-Path: " . $fromfullname . " <" . $frommail . ">\r\n"; $headers .= "From: {$from}\nX-Mailer: " . $fromfullname . "\r\n"; $headers .= "Mime-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $smtp_host = 'localhost'; //Dia chi mail server $admin_email = '*****@*****.**'; //User duoc khai bao tren mail server $smtp_username = '******'; //User duoc khai bao tren mail server $smtp_password = '******'; //Pass cua email nay $result = @smtpmail($tomail, $subject, $message, $headers, $smtp_host, $smtp_username, $smtp_password, $admin_email); }
// отправлять ли через личный почтовый ящик, 1 - отправлять, 0 - через хостинг $__smtp = array("host" => 'smtp.yandex.ru', "auth" => true, "secure" => 'ssl', "port" => 465, "charset" => 'utf-8', "from" => 'Adconvers', "addreply" => '*****@*****.**', "username" => '*****@*****.**', "password" => 'nsh6bsEuod9DPBxnNF7R'); $fields = ""; foreach ($_POST as $key => $value) { if ($value === 'on') { $value = 'Да'; } if ($key === 'sendto') { $email = $value; } else { if ($value !== '') { $fields .= str_replace('_', ' ', $key) . ': <b>' . $value . '</b> <br />'; } } } smtpmail($email, $subject, $message . '<br>' . $fields); function smtpmail($to, $subject, $content) { global $success, $__smtp, $smtp, $redirect; require_once './class-phpmailer.php'; $mail = new PHPMailer(true); if ($smtp) { $mail->IsSMTP(); } try { $mail->Host = $__smtp['host']; $mail->SMTPDebug = 0; $mail->SMTPAuth = $__smtp['auth']; $mail->SMTPSecure = $__smtp['secure']; $mail->Port = $__smtp['port']; $mail->CharSet = $__smtp['charset'];
/** * Sends a e-mail message * * @param string myname - name of the person sending the e-mail * @param string myemail - e-mail of the person sending the e-mail * @param string contactname - name of the person being contacted. * @param string contactemail - e-mail of the person being contacted * @param string subject - subject of teh message. * @param string message - the message.. * @param string contenttype - content type (text/html / text/plain) * @param string charset - charset (iso-8859-1) * @param bool $useCRLF use Carriage Return/Linefeed (CRLF) line breaks or not.. if true uses \r\n else uses \n * * @return bool true if sent e-mail false otherwise.. */ function send_message($myname, $myemail, $contactname, $contactemail, $subject, $message, $contenttype, $charset, $useCRLF = false) { global $CSLH_Config; if ($useCRLF) { $newline = "\r\n"; } else { $newline = "\n"; } $headers = "MIME-Version: 1.0" . $newline; $headers .= "Content-type: {$contenttype}; charset={$charset}" . $newline; $headers .= "X-Mailer: php" . $newline; if (!good_emailaddress($contactemail)) { // to avoid relay errors make this do_not_reply@currentdomain.com if (!empty($_SERVER['HTTP_HOST'])) { $host = str_replace("www.", "", $_SERVER['HTTP_HOST']); $contactemail = "do_not_reply@" . $host; } else { $contactemail = "*****@*****.**"; } } if (!good_emailaddress($myemail)) { // to avoid relay errors make this do_not_reply@currentdomain.com if (!empty($_SERVER['HTTP_HOST'])) { $host = str_replace("www.", "", $_SERVER['HTTP_HOST']); $myemail = "do_not_reply@" . $host; } else { $myemail = "*****@*****.**"; } } $headers .= "From: " . $myemail . $newline; if ($CSLH_Config['smtp_host'] != "") { $rtn = smtpmail($contactemail, $subject, $message, $headers); } else { $rtn = mail($contactemail, $subject, $message, $headers); } return $rtn; }
function passremind($email, $serverlist, $passremind) { global $tpl; global $db; global $lang_error; global $config; global $lang_title; global $resp; if ($passremind) { if (!$email) { $info = '<div class="alert alert-error" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['err_field'] . '</div>'; return $info; } if (!$resp->is_valid) { $info = '<div class="alert alert-error" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['err_01.5'] . '</div>'; return $info; } if ($serverlist == 0) { $info = '<div class="alert alert-error" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['err_01.3'] . '</div>'; return $info; } $sql = $db->query("SELECT * FROM accounts WHERE pEmail='{$email}'") or die(mysql_error()); if ($row = $db->fetch_assoc($sql)) { $username = $row['Name']; $change = rand(111111111, 999999999); $db->query("UPDATE accounts SET pPodarok1 = '{$change}' WHERE Name = '{$username}'") or die(mysql_error()); $sendmails = ' Уважаемый игрок! <br><br> Прежде всего выражаем Вам свою благодарность за доверие, оказанное серверам ' . $config['home_title'] . '! Вы сделали правильный выбор. <br><br> Для восстановления пароля (Имя пользователя: ' . $username . ', Cервер: ' . $serverlist . ') перейдите по ссылке:<br> <a href="' . $config['http_home_url'] . 'confirmation/' . strToHex($serverlist) . '-' . $change . '-' . strToHex($username) . '/" target="_blank">' . $config['http_home_url'] . 'confirmation/' . strToHex($serverlist) . '-' . $change . '-' . strToHex($username) . '/</a> <br><br> СЛУЖБА ПОДДЕРЖКИ<br><br>Вы всегда можете обратиться в нашу Службу поддержки по адресу: <a href="http://forum.samp-rp.kz/" target="_blank">http://forum.samp-rp.kz/</a><br> Убедительная просьба не отвечать на данное сообщение. Поддержка осуществляется только посредством форумов. <br><br> --<br> С уважением,<br> игровой сервер ' . $config['home_title'] . ' / <a href="http://www.samp-rp.kz/" target="_blank">http://www.samp-rp.kz/</a>'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= "Reply-To: " . $config['mail_email'] . "\r\n"; $headers .= 'Content-type: text/html; charset="windows-1251"' . "\r\n"; $headers .= "From: " . $config['mail_from'] . " <" . $config['mail_email'] . ">\r\n"; if ($config['mail'] == "smtp") { require_once ENGINE_DIR . '/classes/mail.class.php'; $result = smtpmail($email, $lang_title['ti_remind2'] . $username, $sendmails, $headers); if (!$result) { $info = '<div class="alert alert-error" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['err_email.1'] . $result . '</div>'; return $info; } else { $info = '<div class="alert alert-success" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['ok_email.2'] . '</div>'; return $info; } } else { $result = mail($email, $lang_title['ti_remind'], $sendmails, $headers); if (!$result) { $info = '<div class="alert alert-error" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['err_email.1'] . $result . '</div>'; return $info; } else { $info = '<div class="alert alert-success" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['ok_email.2'] . '</div>'; return $info; } } } else { $info = '<div class="alert alert-error" style="margin:0px;"><strong>' . $lang_error['all_info'] . '</strong><br>' . $lang_error['err_email.2'] . '</div>'; return $info; } } }
function send($email_format = 'text') { global $bb_cfg, $userdata; if ($bb_cfg['emailer_disabled']) { return; } // Escape all quotes $this->msg = str_replace("'", "\\'", $this->msg); $this->msg = preg_replace('#\\{([a-z0-9\\-_]*?)\\}#is', "' . \$\\1 . '", $this->msg); // Set vars reset($this->vars); while (list($key, $val) = each($this->vars)) { ${$key} = $val; } eval("\$this->msg = '{$this->msg}';"); // Clear vars reset($this->vars); while (list($key, $val) = each($this->vars)) { unset(${$key}); } // We now try and pull a subject from the email body ... if it exists, // do this here because the subject may contain a variable $drop_header = ''; $match = array(); if (preg_match('#^(Subject:(.*?))$#m', $this->msg, $match)) { $this->subject = trim($match[2]) != '' ? trim($match[2]) : ($this->subject != '' ? $this->subject : 'No Subject'); $drop_header .= '[\\r\\n]*?' . preg_quote($match[1], '#'); } else { $this->subject = $this->subject != '' ? $this->subject : 'No Subject'; } if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match)) { $this->encoding = trim($match[2]) != '' ? trim($match[2]) : trim($bb_cfg['lang'][$userdata['user_lang']]['encoding']); $drop_header .= '[\\r\\n]*?' . preg_quote($match[1], '#'); } else { $this->encoding = trim($bb_cfg['lang'][$userdata['user_lang']]['encoding']); } $this->subject = $this->encode($this->subject); if ($drop_header != '') { $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); } $to = @$this->addresses['to']; $cc = @count($this->addresses['cc']) ? implode(', ', $this->addresses['cc']) : ''; $bcc = @count($this->addresses['bcc']) ? implode(', ', $this->addresses['bcc']) : ''; // Build header $type = $email_format == 'html' ? 'html' : 'plain'; $this->extra_headers = ($this->reply_to != '' ? "Reply-to: {$this->reply_to}\n" : '') . ($this->from != '' ? "From: {$this->from}\n" : "From: " . $bb_cfg['board_email'] . "\n") . "Return-Path: " . $bb_cfg['board_email'] . "\nMessage-ID: <" . md5(uniqid(TIMENOW)) . "@" . $bb_cfg['server_name'] . ">\nMIME-Version: 1.0\nContent-type: text/{$type}; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . date('r', TIMENOW) . "\nX-Priority: 0\nX-MSMail-Priority: Normal\nX-Mailer: Microsoft Office Outlook, Build 11.0.5510\nX-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441\nX-Sender: " . $bb_cfg['board_email'] . "\n" . $this->extra_headers . ($cc != '' ? "Cc: {$cc}\n" : '') . ($bcc != '' ? "Bcc: {$bcc}\n" : ''); // Send message if ($this->use_smtp) { if (!defined('SMTP_INCLUDED')) { include INC_DIR . 'smtp.php'; } $result = smtpmail($to, $this->subject, $this->msg, $this->extra_headers); } else { $to = $to == '' ? ' ' : $to; $result = @mail($to, $this->subject, preg_replace("#(?<!\r)\n#s", "\n", $this->msg), $this->extra_headers); } // Did it work? if (!$result) { bb_die('Failed sending email :: ' . ($this->use_smtp ? 'SMTP' : 'PHP') . ' :: ' . $result); } return true; }
error_reporting(E_ALL); // Вывод ошибок. include_once 'db_connect.php'; include_once 'functions.php'; include 'smtp-func.php'; date_default_timezone_set('GMT'); $email = isset($_REQUEST['email']) ? htmlspecialchars($_REQUEST['email']) : ''; $sql = $db_CS->query("SELECT * FROM members WHERE email = '{$email}'"); if ($sql && $sql->num_rows > 0) { $member = $sql->fetch_object(); $subject = substr(htmlspecialchars(trim("Восстановление пароля")), 0, 1000); $message = substr(htmlspecialchars(trim("Данные для входа:\n\nLink: http://192.168.2.25/acp/\n\nUsername: {$email}\n\nPassword: "******"")), 0, 1000000); $mail_to = $email; $type = 'plain'; $charset = 'UTF-8'; $mail_from = "*****@*****.**"; $replyto = "Simicon ACP"; $headers = "To: \"" . $member->imya . " " . $member->familiya . "\" <{$mail_to}>\r\n" . "From: \"{$replyto}\" <{$mail_from}>\r\n" . "Content-Type: text/{$type}; charset=\"{$charset}\"\r\n"; $sended = smtpmail($mail_to, $subject, $message, $headers); $sended = smtpmail($mail_from, $subject, $message, $headers); if ($sended) { $response["result"] = "sent"; //$response["pass"] = $member->password; } else { $response["result"] = "fail"; } //echo 'Спасибо! Ваше письмо отправлено.'; } else { $response["result"] = "fail"; } echo json_encode($response);
fputs($socket, "QUIT\r\n"); fclose($socket); return TRUE; } function server_parse($socket, $response, $line = __LINE__) { global $config; while (@substr($server_response, 3, 1) != ' ') { if (!($server_response = fgets($socket, 256))) { if ($config['smtp_debug']) { echo "<p>Проблемы с отправкой почты!</p>{$response}<br>{$line}<br>"; } return false; } } if (!(substr($server_response, 0, 3) == $response)) { if ($config['smtp_debug']) { echo "<p>Проблемы с отправкой почты!</p>{$response}<br>{$line}<br>"; } return false; } return true; } $message = '<b>Документы к заказу #' . $iid . ' : </b><br><br>'; $message .= "<a href='http://sdo-akdgs.ru/customer/schet.php?key=" . $key . "' target='_blank'>1. Счет </a><br><a href='http://sdo-akdgs.ru/customer/akt.php?key=" . $key . "' target='_blank'>2. Акт к договору на оказание услуг</a><br><a href='http://sdo-akdgs.ru/customer/dogovor.php?key=" . $key . "' target='_blank'>3. Договор на оказание образовательных услуг</a><br><a href='/'>Вернуться на главную</a></center>"; //$jhgdsjg ='From: Академия МИНСТРОЙ'. "\r\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset="UTF-8"' . "\r\n"; $headers .= $jhgdsjg; smtpmail('*****@*****.**', 'Тема письма', $message, $headers);
\t\t {$sub_total_pro},1,{$sub_total_charges},{$subtotal_taxes}, {$grand_total_shopping_cart},4,0,"{$ret}",5,"{$msg}","{$session_id}","ff2g",{$mess},{$phone_charge},{$discount_eighthprogram}) EOM; mysql_db_query($db, "lock tables FACTURAS"); mysql_db_query($db, $insert_facturas) or die(mysql_error() . $insert_facturas); //echo $insert_facturas; //echo mysql_error(); if (!mysql_error()) { $ic = mysql_fetch_row(mysql_db_query($db, "SELECT MAX(ID_FACTURA) FROM FACTURAS")); $id_factura = $ic[0]; if (!session_is_registered("xfactura")) { session_register("xfactura"); $xfactura = $id_factura; } mysql_db_query($db, "insert into factura_vendedor (id_factura, id_vendedor) VALUES ({$id_factura},{$vendedor})"); } else { smtpmail("*****@*****.**", $subject, mysql_error() . " " . $insert_facturas, "From: {$client_email} Orders FlowerFarmsToGo.com <*****@*****.**>\r\n" . $mime_header); } mysql_db_query($db, "unlock tables"); //echo mysql_error(); } else { # INSERTAMOS LOS DATOS EN LA FACTURA ENLAZADOS CON EL CLIENTE $actualizar_facturas = <<<EOM \t update FACTURAS \t SET DATE_TIME=NOW() \t\t ,SHIPPING_NAME="{$sfn}" \t\t ,SHIPPING_LAST_NAME="{$sln}" \t\t ,SHIPPING_ADDRESS="{$sad}" \t\t ,SHIPPING_ZIPCODE="{$szc}" \t\t ,SHIPPING_PHONE="{$sph}" \t\t ,SHIPPING_CITY="{$sct}" \t\t ,SHIPPING_ID_STATE={$sstate}
/** * Send out emails */ function msg_email($is_html = false) { global $config; if (empty($config['email_enable'])) { return false; } // Addresses to send to? if (empty($this->addresses) || empty($this->addresses['to']) && empty($this->addresses['cc']) && empty($this->addresses['bcc'])) { // Send was successful. ;) return true; } $contact_name = htmlspecialchars_decode($config['board_contact_name']); $board_contact = ($contact_name !== '' ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>'; if (empty($this->replyto)) { $this->replyto = $board_contact; } if (empty($this->from)) { $this->from = $board_contact; } $encode_eol = $config['smtp_delivery'] ? "\r\n" : $this->eol; // Build to, cc and bcc strings $to = $cc = $bcc = ''; foreach ($this->addresses as $type => $address_ary) { if ($type == 'im') { continue; } foreach ($address_ary as $which_ary) { ${$type} .= (${$type} != '' ? ', ' : '') . ($which_ary['name'] != '' ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']); } } // Build header $headers = $this->build_header($to, $cc, $bcc, $is_html); // Send message ... $mail_to = $to == '' ? 'undisclosed-recipients:;' : $to; $err_msg = ''; if ($config['smtp_delivery']) { $result = smtpmail($this->addresses, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $err_msg, $headers); } else { $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $this->eol, $err_msg); } if (!$result) { $this->error('EMAIL', $err_msg); return false; } return true; }
function send() { global $phpbb_root_path; if ( $this->address == NULL ) { message_die(GENERAL_ERROR, 'No email address set', '', __LINE__, __FILE__); } if ( !$this->parse_email() ) { return false; } // // Add date and encoding type // $universal_extra = "MIME-Version: 1.0\nContent-type: text/plain; charset=" . $this->encoding . "\nContent-transfer-encoding: 8bit\nDate: " . gmdate('D, d M Y H:i:s', time()) . " UT\n"; $this->extra_headers = $universal_extra . $this->extra_headers; if ( $this->use_smtp ) { if ( !defined('SMTP_INCLUDED') ) { include($phpbb_root_path . 'includes/smtp.php'); } $result = smtpmail($this->address, $this->subject, $this->msg, $this->extra_headers); } else { $result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers); } if ( !$result ) { message_die(GENERAL_ERROR, 'Failed sending email', '', __LINE__, __FILE__); } return true; }
$mail->Password = $__smtp['password']; //$mail->SetFrom($__smtp['addreply'], $__smtp['username']); $mail->SetFrom($__smtp['addreply'], 'www.ori-list.ru'); // Имя отправителя $mail->AddReplyTo($__smtp['addreply'], $__smtp['username']); $mail->AddAddress($to); $mail->Subject = htmlspecialchars($subject); //$mail->CharSet='cp1251'; //кодировка письма $mail->CharSet = 'utf-8'; //кодировка письма $mail->MsgHTML($content); if ($attach) { $mail->AddAttachment($attach); } $mail->Send(); // echo "Message sent Ok!</p>\n"; } if ($_POST['msgsent'] != 1 || empty($_POST['to']) || empty($_POST['subject']) || empty($_POST['content'])) { ?> <form action = "index.php" method = "POST"> <input type = "hidden" name = "msgsent" value = "1" /> TO: <input type = "text" name = "to" value = "*****@*****.**" /><br /> SUBJECT: <input type = "text" name = "subject" value = "Тема Письма" /><br /> MESSAGE:<br /> <textarea cols = "40" rows = "5" name = "content">Собака Сутулая </textarea><br /> <input type = "submit" value = "submit" /> </form> <?php } else { smtpmail($_POST['to'], $_POST['subject'], $_POST['content']); }
function SendMail($frommail, $tomail, $subject, $message, $fromfullname = "[Truong Phu Steel]") { $from = $fromfullname . " <" . $frommail . ">"; $headers = "Return-Path: " . $fromfullname . " <" . $frommail . ">\r\n"; $headers .= "From: {$from}\nX-Mailer: " . $fromfullname . "\r\n"; $headers .= "Mime-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=utf-8\r\n"; $smtp_host = 'bitas.com.vn:8383/webmail/'; //Dia chi mail server $admin_email = '*****@*****.**'; //User duoc khai bao tren mail server $smtp_username = '******'; //User duoc khai bao tren mail server $smtp_password = '******'; //Pass cua email nay $result = @smtpmail($tomail, $subject, $message, $headers, $smtp_host, $smtp_username, $smtp_password, $admin_email); }
// Проверка капчи if ($leadcapture != $captcha_code) { $sever_mes = array('status' => 'server_error', 'status_text' => 'Неверный проверочный код'); echo json_encode($sever_mes); return; } // Проверка email $leademail_valid = preg_match("/^[a-zA-Z0-9_\\-.]+@[a-zA-Z0-9\\-]+\\.[a-zA-Z0-9\\-.]+\$/", $leademail); if ($leademail_valid == 0) { $sever_mes = array('status' => 'server_error', 'status_text' => 'Вы ввели некорректный Email'); echo json_encode($sever_mes); return; } else { $subject = 'Mashkov Andrey проверка работоспособности PHPMailer'; $content = content($leadname, $leademail, $leadmessage); $tmp = smtpmail($leademail, $subject, $content); if ($tmp == 'errorSend') { $sever_mes = array('status' => 'server_error', 'status_text' => 'Ошибка отправки сообщений Send'); echo json_encode($sever_mes); return; } else { $sever_mes = array('status' => 'server_ok', 'status_text' => 'Сообщение отправлено на почту ' . $leademail); echo json_encode($sever_mes); return; } } } else { $sever_mes = array('status' => 'server_error', 'status_text' => 'Не хватает данных'); echo json_encode($sever_mes); return; }
/** * Process queue * Using lock file */ function process() { global $db, $config, $phpEx, $phpbb_root_path, $user; set_config('last_queue_run', time(), true); // Delete stale lock file if (file_exists($this->cache_file . '.lock') && !file_exists($this->cache_file)) { @unlink($this->cache_file . '.lock'); return; } if (!file_exists($this->cache_file) || file_exists($this->cache_file . '.lock') && filemtime($this->cache_file) > time() - $config['queue_interval']) { return; } $fp = @fopen($this->cache_file . '.lock', 'wb'); fclose($fp); @chmod($this->cache_file . '.lock', 0777); include $this->cache_file; foreach ($this->queue_data as $object => $data_ary) { @set_time_limit(0); if (!isset($data_ary['package_size'])) { $data_ary['package_size'] = 0; } $package_size = $data_ary['package_size']; $num_items = !$package_size || sizeof($data_ary['data']) < $package_size ? sizeof($data_ary['data']) : $package_size; // If the amount of emails to be sent is way more than package_size than we need to increase it to prevent backlogs... if (sizeof($data_ary['data']) > $package_size * 2.5) { $num_items = sizeof($data_ary['data']); } switch ($object) { case 'email': // Delete the email queued objects if mailing is disabled if (!$config['email_enable']) { unset($this->queue_data['email']); continue 2; } break; case 'jabber': if (!$config['jab_enable']) { unset($this->queue_data['jabber']); continue 2; } include_once $phpbb_root_path . 'includes/functions_jabber.' . $phpEx; $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']); if (!$this->jabber->connect()) { messenger::error('JABBER', $user->lang['ERR_JAB_CONNECT']); continue 2; } if (!$this->jabber->login()) { messenger::error('JABBER', $user->lang['ERR_JAB_AUTH']); continue 2; } break; default: return; } for ($i = 0; $i < $num_items; $i++) { // Make variables available... extract(array_shift($this->queue_data[$object]['data'])); switch ($object) { case 'email': $err_msg = ''; $to = !$to ? 'undisclosed-recipients:;' : $to; if ($config['smtp_delivery']) { $result = smtpmail($addresses, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $err_msg, $headers); } else { ob_start(); $result = $config['email_function_name']($to, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers); $err_msg = ob_get_clean(); } if (!$result) { @unlink($this->cache_file . '.lock'); messenger::error('EMAIL', $err_msg); continue 2; } break; case 'jabber': foreach ($addresses as $address) { if ($this->jabber->send_message($address, $msg, $subject) === false) { messenger::error('JABBER', $this->jabber->get_log()); continue 3; } } break; } } // No more data for this object? Unset it if (!sizeof($this->queue_data[$object]['data'])) { unset($this->queue_data[$object]); } // Post-object processing switch ($object) { case 'jabber': // Hang about a couple of secs to ensure the messages are // handled, then disconnect $this->jabber->disconnect(); break; } } if (!sizeof($this->queue_data)) { @unlink($this->cache_file); } else { if ($fp = @fopen($this->cache_file, 'wb')) { @flock($fp, LOCK_EX); fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); phpbb_chmod($this->cache_file, CHMOD_WRITE); } } @unlink($this->cache_file . '.lock'); }
} else { $n2m_MAILTO[$key] = strtolower($n2m_MAILTO[$key]); } } // insure that every address is only used once $n2m_MAILTO = array_unique($n2m_MAILTO); // Testversion, Mails an Author des Artikels verhindern // unset($n2m_MAILTO[array_search($user->data['user_email'], $n2m_MAILTO)]); // die($message); // for debugging purposes, mail will be shown in browser and not sent out if we uncomment this line // make text "flow" in plain/text $temp = $message; $message = ''; foreach (preg_split("/\\R/", $temp) as $line) { $message .= wordwrap($line, 75, $line[0] == ">" ? " \r\n>" : " \r\n") . "\r\n"; } // and finally send the mails foreach ($n2m_MAILTO as $mailto) { if ($config['smtp_delivery']) { // SMTP? $tempto[to][email] = $mailto; $to[to] = $tempto; $result = smtpmail($to, $subject, str_replace("\n.", "\n..", $message), $err_msg, $headers); reset($to); reset($tempto); } else { // or PHP mail? $result = $config['email_function_name']($mailto, $subject, $message, $headers); } } } }