function execute($options = null) { // Allow for pre-processing of message & options. Return anything but // true to abort message send. if (method_exists($this, 'preProcess')) { $rt = $this->preProcess(); if ($rt !== true) { return $rt; } } //get options $options = array_merge($this->getOptions(), $options); //invoke system email require_once 'AMP/System/Email.inc.php'; $emailer = new AMPSystem_Email(); $this->emailer = $emailer; // Header text. //This sucks. why can't i just call udm->getData??? $merge = false; if (isset($options['merge_fields']) && $options['merge_fields']) { $constructor = $this->udm->getPlugin('QuickForm', 'Build'); #$constructor->execute(); $merge = $constructor->_formEngine->getValues(); $real_merge = array(); foreach ($merge as $field_name => $value) { if (!is_array($value)) { $real_merge[$field_name] = $value; } } $merge = $real_merge; } $this->message .= $this->_getBodyHeader($options, $merge); $this->message .= $this->prepareMessage($options); // Footer Text. $this->message .= $this->_getBodyFooter($options, $merge); if ($this->containsHTML()) { $this->message = nl2br($this->message); } // Construct the header. $this->header = $this->prepareHeader($options); // Allow for post-processing. Returrn anything but true to abort // message send. if (method_exists($this, 'postProcess')) { $rt = $this->postProcess(); if ($rt !== true) { return $rt; } } $email_target = $this->getEmailTarget($options); if (!$email_target) { return false; } // Send the mail. $emailer->setTarget($email_target); $emailer->setSubject($options['subject']); $emailer->setMessage($this->message); return $emailer->execute(); #return mail( $options['mailto'], $options['subject'], $this->message, $this->header ); }
function execute($options) { $emailer = new AMPSystem_Email(); $emailer->setTarget($this->target); $emailer->setSubject($this->subject); $emailer->setMessage(sprintf($this->message, $options['article_url'], $options['comment_status'], $options['comment_edit_url'])); $emailer->execute(); }
function send_password_reset($account) { $email = new AMPSystem_Email(); $email->setSubject("Reset password for " . AMP_SITE_NAME); $email->setRecipient($account->getData('Email')); $email->setMessage($this->password_reset_message($account)); return $email->execute(); }
function _send_save_email($from, $target) { require_once 'AMP/System/Email.inc.php'; $message = new AMPSystem_Email(); $message->setSender($from); $message->setRecipient($target); $message->setMessage("subscribe"); return $message->execute(); }
function send_sms($email, $message, $subject = NULL, $from = NULL) { $from = AMPSystem_Email::sanitize($from); if (mail($email, $subject, $message, "From: {$from}\r\nReply-To: {$from}\r\nX-Sender: {$from}\r\nReturn-Path: {$from}", "-f{$from}")) { return true; } }
function commit_save() { if (!$this->_form->validate()) { $this->_display->add($this->form); return false; } $message_data = $this->_form->getValues(); if ($sender_name = $message_data['sender_name']) { unset($message_data['sender_name']); } $target = $this->make_address($message_data, 'recipient'); $sender = $this->make_address($message_data, 'sender'); if (!($target && $sender)) { return false; } require_once 'AMP/System/Email.inc.php'; $emailer = new AMPSystem_Email(); $emailer->setTarget($target); $emailer->setSender($sender); if ($sender_name) { $emailer->setSenderName($sender_name); } $emailer->setSubject($message_data['subject']); $emailer->setMessage($message_data['message']); $result = $emailer->execute(); if ($result) { $this->save_message_record($message_data); $message = new AMP_Content_Buffer(); $message->add("<center>Message successfully sent!<br>Thank you!<br><br>[ <a href=\"javascript:window.close();\" onclick='window.close( );'>Close this window</a> ]</center>"); $this->_display->add($message); } return $result; }
function send_email($email, $message, $subject = NULL, $from = NULL, $replyto = NULL) { $mail = new html_mime_mail(array("Reply-To: {$replyto}", "X-Mailer: AMP v3.4", "X-MessageId: {$message_ID}")); # $mail->add_html($message, $text = NULL, $images_dir = NULL) $mail->add_text($textmessage); $mail->send("", $to_addr, $from_name, $from_addr, $subject); $from = AMPSystem_Email::sanitize($from); $replyto = AMPSystem_Email::sanitize($replyto); if (mail($email, $subject, $message, "From: {$from}\r\nReply-To: {$replyto}\r\nX-Sender: {$from}\r\nReturn-Path: {$replyto}", "-f{$replyto}")) { return true; } }
function save($data, $options = array()) { $options = array_merge($this->getOptions(), $options); if ($this->_admin) { return true; } $message = 'subscribe ' . $options['list_name']; $emailer = new AMPSystem_Email(); $emailer->setSender($data['Email']); $emailer->setMessage($message); $emailer->setRecipient($options['subscribe_address']); $emailer->setSubject($message); $emailer->execute(); return true; }
$MM_fieldsStr = "firstname|value|lastname|value|email|value|phone|value|avalible|value|beds|value|floor|value|tents|value|access|value|location|value|transport|value|parking|value|cooking|value|children|value|smoking|value|info|value|publish|value|board|value"; $MM_columnsStr = "firstname|',none,''|lastname|',none,''|email|',none,''|phone|',none,''|avalible|',none,''|beds|',none,''|floor|',none,''|tents|',none,''|access|',none,''|location|',none,''|transport|',none,''|parking|',none,''|cooking|',none,''|children|',none,''|smoking|',none,''|info|',none,''|publish|',none,''|board|none,none,none"; //Mail to admin for confirmation if ($confirm == "admin") { $MM_editRedirectUrl = "housing_confirm.php?step=admin"; $messagetext = $_POST["firstname"] . ' ' . $_POST["lastname"] . " has added a posting to the ride board\n Information:{$firstname}, {$Lastname}, {$email}, {$phone}, {$avalible}, {$beds}, {$floor}, {$tents}, {$access}, {$location}, {$transport}, {$parking}, {$cooking}, {$children}, {$smoking}, {$info} \n\nPlease visit " . $Web_url . "housing_confirm.php?email=" . $_POST["email"] . " to publish"; if ($MM_email_housing) { mail($MM_email_housing, "new housing board posting", "{$messagetext}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); } } //Mail to poster for confirmation if ($confirm == "poster") { $MM_editRedirectUrl = "housing_confirm.php?step=email"; $messagetext2 = "\nPlease visit " . $Web_url . "housing_confirm.php?email=" . $_POST["email"] . " to confirm your housing board posting./n/n Information:{$firstname}, {$Lastname}/n {$email}/n {$phone}/n {$avalible}/n {$beds}/n {$floor}/n {$tents}/n {$access}/n {$location}/n {$transport}/n {$parking}/n {$cooking}/n {$children}/n {$smoking}/n {$info} "; if ($_POST["email"]) { mail($_POST["email"], "confirm your housing board posting", "{$messagetext2}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); } } require "DBConnections/insetstuff.php"; require "DBConnections/dataactions.php"; } ?> <table width="100%" border="0" cellspacing="0" cellpadding="15"> <tr> <td> <form method="POST" action="<?php echo $MM_editAction; ?> " name="form1">
if ($checkfirst->RecordCount() > 0) { $MM_abortEdit = 1; $problem = "<strong><p class=docbox>The email address you entered is already registered on the ride board. Please use <a href=\"rides.php?uid=" . $checkfirst->Fields("uniqueid") . "\">this link</a> to login or enter new information below.</strong><P>"; } if (!$MM_abortEdit) { //Mail to admin for confirmation if ($confirm == "admin") { $MM_editRedirectUrl = $board . "_signin.php?step=admin"; $messagetext = "{$firstname} {$lastname} has added a posting on the {$board} board\n\n Information:\n Phone: {$phone}\n Email: {$email}\n State: {$state}\n Departing From: {$depatingfrom}\n Departure Date: {$depaturedate}\n Returning to: {$returningto}\n Return Date:{$returndate}\n Number of People: {$numpeople}\n Comments: {$commets} \n\nPlease visit " . $Web_url . $board . "_signin.php?uid={$uniqiueid} to publish"; mail("{$MM_email_ride}", "new {$board} board posting", "{$messagetext}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\n"); } //Mail to poster for confirmation if ($confirm == "poster") { $MM_editRedirectUrl = $board . "_signin.php?step=email"; $messagetext2 = "\nPlease visit <a href=\"" . $Web_url . $board . "_signin.php?uid={$uniqueid}&action=confirm\">" . $Web_url . $board . "_signin.php?uid={$uniqueid}&action=confirm</A> to confirm your {$board} board posting.\n\n Information:\n Phone: {$phone}\n Email: {$email}\n State: {$state}\n Departing From: {$depatingfrom}\n Departure Date: {$depaturedate}\n Returning to: {$returningto}\n Return Date:{$returndate}\n Number of People: {$numpeople}\n Comments: {$commets} \n "; mail("{$pemail}", "Confirm your {$board} board posting", "{$messagetext2}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\n"); } } } #} else { # echo $dbcon->ErrorMsg(); #} require "DBConnections/insetstuff.php"; require "DBConnections/dataactions.php"; ob_end_flush(); } if ($MM_update) { echo "MMUPDATE<BR>"; } if ($MM_insert) { echo "MMINSERT<BR>";
require_once 'AMP/Form/Element/Captcha.inc.php'; $captcha_demo = new PhpCaptcha(array()); $captcha_valid = $captcha_demo->Validate($_POST['captcha']); if (!$captcha_valid) { $_REQUEST['kill_insert'] = 'captcha'; $_GET['showask'] = '1'; $captcha_message = AMP_TEXT_ERROR_FORM_CAPTCHA_FAILED; } } if (isset($_REQUEST["MM_insert"]) && $_REQUEST["MM_insert"] && $captcha_valid) { $MM_editTable = "faq"; $MM_editRedirectUrl = "faq.php"; $MM_fieldsStr = "question|value|first|value|last|value|email|value"; $MM_columnsStr = "question|',none,''|firstname|',none,''|lastname|',none,''|email|',none,''"; if ($MM_email_faq) { mail($MM_email_faq, "faq needs response", "There is a new FAQ that needs answering: " . $_POST["question"] . " From:" . $_POST["email"] . " \nPlease visit {$Web_url}/system/faq.php?action=list to answer", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); } require "Connections/insetstuff.php"; require "Connections/dataactions.php"; header("Location: faq.php"); } $type__MMColParam = "0"; if (isset($_GET["typeid"])) { $type__MMColParam = mysql_real_escape_string($_GET["typeid"]); } $called__MMColParam = "1"; if (isset($_GET["id"])) { $called__MMColParam = mysql_real_escape_string($_GET["id"]); } $type = $dbcon->CacheExecute("SELECT * FROM faqtype WHERE id = " . $type__MMColParam . "") or AMP_redirect('search.php'); $called = $dbcon->CacheExecute("SELECT * FROM faq WHERE id = " . $called__MMColParam . "") or AMP_redirect('search.php');
function senddelemail($pemail) { global $board, $dbcon, $Web_url, $modinid; $getuid = $dbcon->Execute("Select id, uniqueid from {$board} where pemail = " . $dbcon->qstr($pemail)); $uid = $getuid->Fields("uniqueid"); $messagetext = "To remove your listing simply visit this page " . $Web_url . $board . "_signin.php?deluid={$uid}"; if (email_is_valid($pemail)) { mail($pemail, "remove your {$board} posting", "{$messagetext}", "From:" . AMPSystem_Email::sanitize($MM_email_from)); echo "An e-mail has been sent to you with instructions on how to remove yourself from the board."; } else { echo "Your email is invalid or not in our system<br><br>"; deleteform(); } }
function sendOtp($email_address, $uid) { $secret = $this->_handler->get_seed(); $hash = $this->_handler->make_secure_cookie($email_address, $this->_default_permission, $secret); $this->_handler->save_session($hash, $secret); require_once 'AMP/System/Email.inc.php'; $emailMessage = new AMPSystem_Email(); $emailMessage->setRecipient($email_address); $emailMessage->setSubject(AMP_SITE_NAME . ' Password ' . ucfirst($this->_current_action)); $emailMessage->setMessage('Passcode: ' . $hash . "\n or login here: " . AMP_SITE_URL . substr($this->getLoginUrl(array('uid=' . $uid, 'otp=' . $hash)), 1)); return $emailMessage->execute(); }
Description: housing remove page GET VARS show SYS VARS $MM_email_from To Do: *********************/ $modid = 3; $intro_id = 19; include "AMP/BaseDB.php"; include "AMP/BaseTemplate.php"; include "AMP/BaseModuleIntro.php"; include_once "AMP/System/Email.inc.php"; if (isset($_POST["MM_insert"])) { $messagetext = "To remove your listing simply visit this page " . $Web_url . "housing_remove2.php?email=" . $_POST["email"] . " and press the remove button"; if ($_POST["email"]) { mail($_POST["email"], "remove your housing posting", "{$messagetext}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); header("Location: housing_remove.php?show=yes"); } } $emails = $dbcon->Execute("SELECT * FROM housing where publish='1' and board='2' ORDER BY email ASC") or die($dbcon->ErrorMsg()); $emails_numRows = 0; $emails__totalRows = $emails->RecordCount(); ?> <p>Select your e-mail</p> <form ACTION="<?php echo $MM_editAction; ?> " METHOD="POST" name="form1"> <select name="email"> <?php if ($emails__totalRows > 0) {
// *** Insert Record: set Variables if (isset($MM_insert)) { $MM_editTable = "ride"; $MM_fieldsStr = "firstname|value|lastname|value|phone|value|email|value|depatingfrom|value|depaturedate|value|returningto|value|returndate|value|numpeople|value|ride|value|commets|value|publish|value|board|value"; $MM_columnsStr = "firstname|',none,''|lastname|',none,''|phone|',none,''|email|',none,''|depatingfrom|',none,''|depaturedate|',none,''|returningto|',none,''|returndate|',none,''|numpeople|',none,''|need|',none,''|commets|',none,''|publish|',none,''|board|none,none,none"; //Mail to admin for confirmation if ($confirm == "admin") { $MM_editRedirectUrl = "ride_confirm.php?step=admin"; $messagetext = "{$firstname} {$lastname} has added a posting to the ride board\n Information:{$phone}, {$email}, {$departingform}, {$depaturedate}, {$returningto}, {$retundate}, {$numpeople}, {$ride}, {$comments} \n\nPlease visit " . $Web_url . "ride_confirm.php?email={$email} to publish"; mail("{$MM_email_ride}", "new ride board posting", "{$messagetext}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); } //Mail to poster for confirmation if ($confirm == "poster") { $MM_editRedirectUrl = "ride_confirm.php?step=email"; $messagetext2 = "\nPlease visit " . $Web_url . "ride_confirm.php?email={$email} to confirm your ride board posting./n/n Information: {$phone}, {$email}, {$departingform}, {$depaturedate}, {$returningto}, {$retundate}, {$numpeople}, {$ride}, {$comments} "; mail("{$email}", "confirm your ride board posting", "{$messagetext2}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); } require "DBConnections/insetstuff.php"; require "DBConnections/dataactions.php"; } ?> <form name="rieinput" action="<?php echo $MM_editAction; ?> " method="POST"> <table width="100%" border="0" cellspacing="0"> <tr> <td align="right" class="form"><div align="left">First Name</div></td> <td> <input name="firstname" type="text" size="35" > </td> </tr> <tr>
function save($data) { $options = $this->getOptions(); if (!isset($this->udm->uid)) { $this->udm->errorMessage("Invalid Contact Info"); return false; } if (!(isset($data['action_id']) && $data['action_id'])) { $this->udm->errorMessage("No Appointment Selected"); return; } $schedule = new Schedule($this->dbcon, $options['schedule_id']); if (!$schedule->makeAppointment($this->udm->uid, $data['action_id'])) { $this->udm->errorMessage("The requested schedule time is not avaiable"); return false; } $item =& $schedule->getScheduleItem($data['action_id']); $appt_contact_data = $this->udm->getData(); $recipients = array(); if (isset($options['email_contact_schedule']) && $options['email_contact_schedule']) { $recipients['schedule'] = $item->getOwnerEmail(); } if (isset($options['email_contact_appointment']) && $options['email_contact_appointment']) { $recipients['appointment'] = $appt_contact_data['Email']; } if (empty($recipients)) { return true; } $item_data = $item->getData(); $item_data['schedule_contact_name'] = $item->getOwnerName(); $item_data['schedule_contact_email'] = $item->getOwnerEmail(); $item_data['schedule_start_time_text'] = $item->getTimeText(); $item_data = array_merge($item_data, $this->getAppointmentContactData()); foreach ($recipients as $which_contact => $email) { $text_id = $options['email_contact_' . $which_contact]; $text = new AMPSystem_IntroText($this->dbcon, $text_id); $sch_email = new AMPSystem_Email(); $sch_email->setSubject($text->getTitle()); $sch_email->setRecipient($email); $sch_email->setMessage($text->mergeBodyFields($item_data)); if (!$sch_email->execute()) { trigger_error(sprintf(AMP_ERROR_SCHEDULE_APPOINTMENT_EMAIL_NOT_SENT, $email)); } } return true; }
// *** Edit Operations: declare Tables $MM_editAction = $PHP_SELF; if ($QUERY_STRING) { $MM_editAction = $MM_editAction . "?" . $QUERY_STRING; } $MM_abortEdit = 0; $MM_editQuery = ""; // *** Insert Record: set variables if (isset($MM_insert)) { // $MM_editConnection = $MM__STRING; $MM_editTable = "articles"; $MM_editRedirectUrl = "index.php"; $date = DateConvertIn($date); $MM_fieldsStr = "type|value|class|value|select3|value|uselink2|value|uselink|value|publish|value|titlex|value|subtitle|value|html|value|article|value|textfield|value|author|value|linktext|value|date|value|usedate|value|doc|value|radiobutton|value|link|value|linkuse|value|new|value|actionitem|value|actionlink|value|piccap|value|picture|value|usepict|value|morelink|value|usemore|value|ID|value|pageorder|value"; $MM_columnsStr = "type|none,none,NULL|class|none,none,NULL|catagory|none,none,NULL|fplink|none,1,0|uselink|none,1,0|publish|none,1,0|title|',none,''|subtitile|',none,''|html|none,1,0|test|',none,''|shortdesc|',none,''|author|',none,''|linktext|',none,''|date|',none,NULL|usedate|none,1,0|doc|',none,''|doctype|',none,''|link|',none,''|linkover|none,1,0|new|none,1,0|actionitem|none,1,0|actionlink|none,none,NULL|piccap|',none,''|picture|',none,''|picuse|none,none,NULL|morelink|',none,''|usemore|none,1,0|enteredby|none,none,NULL|pageorder|none,none,NULL"; mail("{$MM_email_usersubmit}", "user submited article", "{$article}", "From: " . AMPSystem_Email::sanitize($author) . "\nX-Mailer: My PHP Script\n"); require "Connections/insetstuff.php"; } require "Connections/dataactions.php"; $typelab = $dbcon->Execute("SELECT id, type FROM articletype ORDER BY type ASC") or die($dbcon->ErrorMsg()); $typelab_numRows = 0; $typelab__totalRows = $typelab->RecordCount(); $sublab = $dbcon->Execute("SELECT id, subname FROM articlesubtype") or die($dbcon->ErrorMsg()); $sublab_numRows = 0; $sublab__totalRows = $sublab->RecordCount(); $catagory = $dbcon->Execute("SELECT * FROM catagory ORDER BY catname ASC") or die($dbcon->ErrorMsg()); $catagory_numRows = 0; $catagory__totalRows = $catagory->RecordCount(); $action = $dbcon->Execute("SELECT * FROM sendfax ORDER BY subject ASC") or die($dbcon->ErrorMsg()); $action_numRows = 0; $action__totalRows = $action->RecordCount();
include "AMP/BaseDB.php"; include "AMP/BaseTemplate.php"; include "AMP/BaseModuleIntro.php"; include_once "AMP/System/Email.inc.php"; include "dropdown.php"; // *** Edit Operations: declare Tables $MM_editAction = $PHP_SELF; if ($QUERY_STRING) { $MM_editAction = $MM_editAction . "?" . $QUERY_STRING; } $MM_abortEdit = 0; $MM_editQuery = ""; // *** Insert Record: set Variables if (isset($MM_insert)) { $messagetext = "To remove your listing simply visit this page " . $Web_url . "ride_remove2.php?email={$email} and press the remove button"; mail("{$email}", "remove your ride posting", "{$messagetext}", "From: " . AMPSystem_Email::sanitize($MM_email_from) . "\nX-Mailer: My PHP Script\n"); header("Location: ride_remove.php?show=yes"); } $emails = $dbcon->Execute("SELECT * FROM ride where publish='1' and board='2' ORDER BY email ASC"); if ($emails) { $emails_numRows = 0; $emails__totalRows = $emails->RecordCount(); ?> <p>Select your e-mail</p> <form ACTION="<?php echo $MM_editAction; ?> " METHOD="POST" name="form1"> <select name="email">
$form->Build(); $form->enforceRules(); $showForm = !($form->submitted() && $form->validate()); $intro_id = $showForm ? AMP_CONTENT_PUBLICPAGE_ID_CONTACT_US : AMP_CONTENT_PUBLICPAGE_ID_CONTACT_US_RESPONSE; $modid = AMP_MODULE_ID_CONTACT_US; require_once "AMP/BaseTemplate.php"; $flash =& AMP_System_Flash::instance(); print $flash->execute(); require_once "AMP/BaseModuleIntro.php"; if (!isset($MM_email_contact)) { $MM_email_contact = false; } if (!defined('AMP_SITE_EMAIL_CONTACT')) { define('AMP_SITE_EMAIL_CONTACT', $MM_email_contact); } if ($showForm) { print $form->output(); } elseif (AMP_SITE_EMAIL_CONTACT) { $data = $form->getValues(); require_once 'AMP/System/Email.inc.php'; $email_maker = new AMPSystem_Email(); $email_maker->setRecipient(AMP_SITE_EMAIL_CONTACT); $email_maker->setMessage($data['message']); $email_maker->setSender($data['sender_email']); $email_maker->setSenderName(false); $email_maker->setSubject($data['subject']); $email_maker->execute(); } else { print AMP_TEXT_ERROR_TOOL_NOT_CONFIGURED; } require_once "AMP/BaseFooter.php";