function error($description, $error_place = '', $params = array()) { if (defined('DEVELOPER_ENVIROMENT')) { trigger_error('error', E_USER_WARNING); echo $description . '<br>' . $error_place . '<br><pre>'; print_r($params); echo '</pre>'; } debug::write_error($description, $error_place, $params); rollback_user_transaction(); if (debug::is_console_enabled()) { echo debug::parse_html_console(); } else { $message = ''; if ($user_id = user::get_id()) { $message .= "user id:\t{$user_id}\nlogin:\t\t" . user::get_login() . "\ne-mail:\t\t" . user::get_email() . "\n"; } $message .= "ip:\t\t" . sys::client_ip() . "\nrequest:\t" . REQUEST_URI . "\nerror:\t\t{$title}\ndescription:\t{$msg}"; $mail = new mime_mail(); $mail->set_body($message); $mail->build_message(); $mail->send('developer', DEVELOPER_EMAIL, '', WEBSITE_EMAIL, $_SERVER['HTTP_HOST'] . ' internal error!'); } ob_end_flush(); exit; }
function send_plain_mail($recipients, $sender, $subject, $body, $headers = array()) { $mail = new mime_mail(); $mail->set_text($body); $mail->set_subject($subject); $mail->set_from($sender); foreach ($headers as $key => $value) { $mail->set_header($key, $value); } return $mail->send($recipients); }
function send_html_mail($recipients, $sender, $subject, $html, $text = null, $headers = array()) { $mail = new mime_mail(); $mail->set_html($html, $text); $mail->set_subject($subject); $mail->set_from($sender); foreach ($headers as $key => $value) { $mail->set_header($key, $value); } return $mail->send($recipients); }
function send_html_mail($recipients, $sender, $subject, $html, $text = null, $headers = array()) { $mail = new mime_mail(); //$text = convert_html_to_plain_text(preg_replace('(<p>|br>)', "\n", $html)); $mail->set_html($html, $text); $mail->set_subject($subject); $mail->set_from($sender); foreach ($headers as $key => $value) { $mail->set_header($key, $value); } return $mail->send($recipients); }
function _valid_perform() { $mail_data = $this->dataspace->export(); $body = sprintf(strings::get('body_template', 'feedback'), $mail_data['sender_name'], $mail_data['sender_email'], $mail_data['body']); $body = str_replace('<br>', "\n", $body); $subject = sprintf(strings::get('message_subject', 'feedback'), $mail_data['subject'], $_SERVER['HTTP_HOST']); $mail = new mime_mail(); $mail->set_body($body); $mail->build_message(); $recipient_email = constant('ADMINISTRATOR_EMAIL'); if (!$recipient_email || !$mail->send('administrator', $recipient_email, $mail_data['sender_name'], $mail_data['sender_email'], $subject)) { message_box::write_error(strings::get('mail_not_sent', 'feedback')); return false; } return true; }
# read a JPEG picture from the disk $fd = fopen($filename, "r"); $data = fread($fd, filesize($filename)); fclose($fd); # create object instance $mail = new mime_mail(); # set all data slots $mail->from = $from; $mail->to = $email; $mail->subject = $predmet; $mail->body = $text; # append the attachment $filename = $zipdir . "/" . $_SESSION['step_all_4']['presentation_name'] . ".zip"; $mail->add_attachment($data, $filename, $content_type); # send e-mail if ($mail->send()) { echo "<h2 class=\"ok\">" . $webgen_send_to_email_send[$language] . "</h2>"; } else { echo "<h2 class=\"error\">" . $webgen_send_to_email_error[$language] . "</h2>"; } if ("c" == $_SESSION['step_pp_20']['send_choice']) { if (strlen($_SESSION['step_all_2']['user_name']) > 2 && strlen($_SESSION['step_all_4']['presentation_name']) > 2) { recursive_remove_directory("./presentations/" . $_SESSION['step_all_2']['user_name'] . "/" . $_SESSION['step_all_4']['presentation_name']); } else { echo "<h2 class=\"error\">" . $webgen_delete_error[$language] . "</h2>"; } } } ?> <input name="empty" type="hidden" />
$emails->setQuery("select email from rex_email"); for ($i = 0; $i < $emails->getRows(); $i++) { $from = stripslashes($from); $subject = stripslashes($subject); $body = stripslashes($body); $to = stripslashes($emails->getValue("rex_email.email")); $mail = new mime_mail(); $mail->from = $from; $mail->headers = "Errors-To: " . $from; $mail->body = $body; // $mail->cc = stripslashes($cc); // $mail->bcc = stripslashes($bcc); $mail->prepare(); $mail->to = $to; $mail->subject = $subject; $mail->send(); $emails->next(); } // no form $form_show = false; $errmsg = "Ihre Eingaben wurden als Newsletter geschickt !"; } } if ($errmsg != "") { echo "<table border=0 cellpadding=5 cellspacing=1 width=770><tr><td colspan=2 class=warning>{$errmsg}</td></tr></table><br>"; } echo "\t<table border=0 cellpadding=5 cellspacing=1 width=770>\n\t<form action=index.php method=post>\n\t<input type=hidden name=page value=community>\n\t<input type=hidden name=subpage value=newsletter>\n\t<input type=hidden name=submit value=1>"; if ($form_show) { $from = stripslashes(htmlentities($from)); $subject = stripslashes(htmlentities($subject)); $body = stripslashes(htmlentities($body));
function send_activate_password_email(&$user_data, $password) { global $_SERVER; $http_host = $_SERVER['HTTP_HOST']; $filename = TEMPLATES_DIR . '/user/generated_password_mail.html'; if (!file_exists($filename)) { error('template file for password notification email not found!', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, array('file_name' => $filename)); } $fd = fopen($filename, "r"); $contents = fread($fd, filesize($filename)); fclose($fd); $contents = str_replace('%website_name%', $http_host, $contents); $contents = str_replace('%user_name%', $user_data['name'] . ' ' . $user_data['lastname'], $contents); $contents = str_replace('%new_password%', $password, $contents); $contents = str_replace('%website_href%', $http_host, $contents); $contents = str_replace('%website_email%', ADMINISTRATOR_EMAIL, $contents); $activate_href = 'http://' . $http_host . '/root/activate_password?user='******'email'] . '&id=' . $user_data['password']; $contents = str_replace('%activate_href%', $activate_href, $contents); include_once LIMB_DIR . '/core/lib/mail/mime_mail.class.php'; $mail = new mime_mail(); $mail->set_body($contents); $mail->build_message(); if (!$mail->send($user_data['name'] . ' ' . $user_data['lastname'], $user_data['email'], $http_host, ADMINISTRATOR_EMAIL, strings::get('generate_password_theme', 'user'))) { debug::write_error('error while sending password notification email', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__); return false; } else { return true; } }
function my_mail($message, $subject = HOST, $to = EMAIL_ADMIN, $from = EMAIL_ADMIN, $headers = "") { $mail = new mime_mail(); $mail->from = $from; $mail->to = $to; $mail->subject = $subject; $mail->body = normalize($message); //$mail->add_attachment($aMail['file'], $aMail['filename'], $mimetype); $mail->send(); /* //$headers .= "To: ".$to."\r\n"; $headers .= "From: ".$from."\r\n"; if (!@mail($to, $subject, $message, $headers)) { //safewrite(FLGR_MESSAGES.'/'.getmicrotime().'.txt', $message); } */ }