$modx->mail->set(modMail::MAIL_FROM,'[email protected]');
[2016-07-11 12:06:26] (ERROR @ /var/sites/m/moorparknorthwoodhouses.forsale/public_html/core/cache/includes/elements/modsnippet/62.include.cache.php : 13) An error occurred while trying to send the email:
[[!Register? &submitVar=`registerbtn` &activationResourceId=`14` &activationEmailTpl=`ActivationEmailTpl` &activationEmailSubject=`Thanks for Registering!` &submittedResourceId=`13` &usergroups=`Members` &validate=`nospam:blank, username:required:minLength=^6^, password:required:minLength=^6^, password_confirm:password_confirm=^password^, fullname:required, email:required:email` &placeholderPrefix=`reg.` &successMsg=`Thanks for registering!` &postHooks=`notifyAdmin` ]]
$message = 'Hi, a new User signed up: '.$hook->getValue('username') . ' with email '.$hook->getValue('email').'.'; $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->set(modMail::MAIL_BODY,$message); $modx->mail->set(modMail::MAIL_FROM,'[email protected]'); $modx->mail->set(modMail::MAIL_FROM_NAME,'myGmail Auto'); $modx->mail->set(modMail::MAIL_SENDER,'myGmail Auto'); $modx->mail->set(modMail::MAIL_SUBJECT,'New User Signed Up'); $modx->mail->address('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: '.$err); } $modx->mail->reset(); /* tell our snippet we're good and can continue */ return true;
[[!Register? .... &postHooks=`notifyAdmin` ]] //I place notifyAdmin at the very end.notifyAdmin
$message = 'Hi, a new User signed up: '.$hook->getValue('username') . ' with email '.$hook->getValue('email').'.'; $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->set(modMail::MAIL_BODY,$message); $modx->mail->set(modMail::MAIL_FROM,'[email protected]'); $modx->mail->set(modMail::MAIL_FROM_NAME,'myGmail Auto'); $modx->mail->set(modMail::MAIL_SENDER,'myGmail Auto'); $modx->mail->set(modMail::MAIL_SUBJECT,'New User Signed Up'); $modx->mail->address('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: '.$err); } $modx->mail->reset(); /* tell our snippet we're good and can continue */ return true;
$message = 'Hi, a new User signed up: '.$hook->getValue('username') . ' with email '.$hook->getValue('email').'.'; $modx->getService('mail', 'mail.modPHPMailer'); $modx->mail->set(modMail::MAIL_BODY,$message); $modx->mail->set(modMail::MAIL_FROM,'[email protected]'); $modx->mail->set(modMail::MAIL_FROM_NAME,'Jerrys Site'); $modx->mail->set(modMail::MAIL_SENDER,'Jerrys Site'); $modx->mail->set(modMail::MAIL_SUBJECT,'New User Signed Up'); $modx->mail->address('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: '.$err); } $modx->mail->reset(); /* tell our snippet we're good and can continue */ return true;