[[!Register? &submitVar=`registerbtn` &activationResourceId=`19` &activationEmailTpl=`lgnActivateEmailTpl` &activationEmailSubject=`Thanks for Registering!` &submittedResourceId=`23` &usergroups=`2` &postHooks=`adminEmailHook` &validate=`nospam:blank, username:required:minLength=^6^, password:required:minLength=^6^, password_confirm:password_confirm=^password^, fullname:required, email:required:email` ]]
<?php $message = 'Hi, a new User signed up: '.$hook->getValue('username') . ' with email '.$hook->getValue('email').'. To activate this User please login to the ModX Manager and navigate to the Users menu under the Manage drop down menu.'; $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,'Company'); $modx->mail->set(modMail::MAIL_SENDER,'Company'); $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 new user alert email: '.$err); } $modx->mail->reset(); /* tell our snippet we're good and can continue */ return true;
This question has been answered by istvan.velsz. See the first response.
$modx->mail->set(modMail::MAIL_FROM,'[email protected]');
if your site is online try to change this e-mail
$modx->mail->set(modMail::MAIL_FROM,'[email protected]');
You need a real e-mail from domain of your site
$modx->mail->set(modMail::MAIL_SENDER,'[email protected]');