Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
https://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/modx-services/modmail
/* modx mail service */
$modx->getService('mail', 'mail.modPHPMailer');
$modx->mail->set(modMail::MAIL_BODY,$message);
$modx->mail->set(modMail::MAIL_FROM,$from);
$modx->mail->set(modMail::MAIL_FROM_NAME,'Quick Quote');
$modx->mail->set(modMail::MAIL_SUBJECT,'Lease Quote #'.$id.'');
$modx->mail->address('to','sales@theleaseoutlet.dsmessage.com');
//$modx->mail->address('reply-to','me@xexample.org');
$modx->mail->setHTML(true);
if (!$modx->mail->send()) {
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$modx->mail->mailer->ErrorInfo);
}
$modx->mail->reset();
/* /eof modx mail service */
///examples
$modx->getOption('emailsender');
$message = "Form error on page: <strong>" . $_POST["page"] . "</strong><br>
at element: <strong>" . $_POST["element"] . "</strong><br>
in browser: <strong>" . $_POST["browser"] . "</strong>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.