I have a request for newsletter support in ModX. I'm running ditsnews 0.2.0-alpha3 with Revo 2.2.6pl. When subscription process is started, ditsnews tries to send the subscription mail put stops with error
[2013-03-30 18:05:53] (ERROR @ /index.php) An error occurred while trying to send the confirmation email to (subscriber email address)
So I put some log statements in core/components/ditsnews/model/ditsnews/ditsnews.class.php . The data for modx->mail look as I expect them to do.
To test, wether we have server related problems, I put the following to a snippet:
<?php
$msg1='<h1>Bestätigung der Anmeldung erforderlich (Opt-In)</h1>\n'.
'Hallo, (Vorname),<br />\n<br />\n'.
'danke für die Anmeldung am Newsletter. Um die Anmeldung zu bestätigen, bitte '.
'<a href="http://www.(domain).de/anmeldebestaetigung.html?s=19&c=18f6406f66102d88c847d3b24660ebb9">hier</a>'.
' klicken, du landest dann auf unserer Bestätigungsseite./';
$modx->getService('mail', 'mail.modPHPMailer');
$modx->mail->set(modMail::MAIL_BODY,$msg1);
$modx->mail->set(modMail::MAIL_FROM,'newsletter@(domain).de');
$modx->mail->set(modMail::MAIL_FROM_NAME,'Newsletter');
$modx->mail->set(modMail::MAIL_SUBJECT,'Ihr Newsletter-Abonnement');
$modx->mail->address('to','[email protected]');
$modx->mail->address('reply-to','newsletter@(domain).de');
$modx->mail->setHTML(true);
if (!$modx->mail->send()) {
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email:(testmail) '.$modx->mail->mailer->ErrorInfo);
}
$modx->mail->reset();
This runs fine, until I click the link in the mail, which results in
subscriber/code combination invalid
any help really appreciated
regards
Dieter