Created
November 30, 2018 00:47
-
-
Save dubrod/05cf58c5a0c8e55dd962dc74cfff1062 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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','[email protected]'); | |
//$modx->mail->address('reply-to','[email protected]'); | |
$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