$this->modx->mail->address('to', $email, $name);
$this->modx->mail->address('to', $email, $name); $this->modx->mail->address('bcc', '[email protected]');
Same problem here. "modPHPMailer" doesn´t work on our system. Are there any important settings which we have to change? For example "Use SMTP"=yes?]]>
Only thing I could think of - where the snippet calls for "$modx->getService(’mail’, ’mail.modPHPMailer’)" is that a particular package that needs to be installed or a system setting that needs to be changed?
<?php $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,'MyDomain'); $modx->mail->set(modMail::MAIL_SENDER,'MyDomain'); $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? &submitVar=`registerbtn` &activationResourceId=`978` &activationEmailTpl=`bcActivationEmailTpl` &activationEmailSubject=`Thanks for Registering!` &submittedResourceId=`976` &usergroups=`BadCamberg` &postHooks=`bcHookAdminEmail` ]]