web:modx:revolution:modmail
modMail
メールサービスを提供するための抽象クラス。
実装クラス(例:phpmailerのような)で拡張する必要があります。1)
<?php $message = $modx->getChunk('myEmailTemplate'); $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->set(modMail::MAIL_BODY,$message); $modx->mail->set(modMail::MAIL_FROM,'me@example.org'); $modx->mail->set(modMail::MAIL_FROM_NAME,'Johnny Tester'); $modx->mail->set(modMail::MAIL_SENDER,'Johnny Tester'); $modx->mail->set(modMail::MAIL_SUBJECT,'Check out my new email template!'); $modx->mail->address('to','user@example.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(); ?>
参考
web/modx/revolution/modmail.txt · 最終更新: 2017/04/14 05:21 by 127.0.0.1