Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This DOES NOT work:
- // message and recipient are both strings
- function sendEmail($message, $recipient)
- {
- require_once(e_HANDLER . 'mail_manager_class.php');
- $mailer = new e107MailManager;
- $mailer->Mailer = 'php';
- // Create the mail body
- $mailData = array(
- 'mail_total_count' => 1,
- 'mail_content_status' => MAIL_STATUS_TEMP,
- 'mail_create_app' => 'core',
- 'mail_title' => 'NOTIFY',
- 'mail_subject' => 'Test email',
- 'mail_sender_name' => 'Me',
- 'mail_notify_complete' => 0,
- 'mail_body' => $message,
- 'template' => 'notify',
- 'mail_send_style' => 'notify',
- );
- // pass recipient email address as a string
- $mailer->sendEmails('notify', $mailData, $recipient);
- }
- This DOES work:
- function sendEmail($message, $recipient)
- {
- require_once(e_HANDLER . 'mail_manager_class.php');
- $mailer = new e107MailManager;
- $mailer->Mailer = 'php';
- // Create the mail body
- $mailData = array(
- 'mail_total_count' => 1,
- 'mail_content_status' => MAIL_STATUS_TEMP,
- 'mail_create_app' => 'core',
- 'mail_title' => 'NOTIFY',
- 'mail_subject' => 'Test email',
- 'mail_sender_name' => 'Me',
- 'mail_notify_complete' => 0,
- 'mail_body' => $message,
- 'template' => 'notify',
- 'mail_send_style' => 'notify',
- );
- $recipientData = array(array('mail_recipient_email' => $recipient, 'mail_recipient_name' => $recipient));
- $mailer->sendEmails('notify', $mailData, $recipientData);
- }
Advertisement
Add Comment
Please, Sign In to add comment