SOLVED: Getting error from PHPmailer Invalid address: (punyEncode) after update

Hi i’m trying to send an email with mail.modPHPMailer ( $modx->getService('mail', 'mail.modPHPMailer');) it does not work and i’m getting an error in the log files saying:

An error occurred while trying to send the email: Invalid address: (punyEncode)

This is with a snippet that used to work fine. but since i updated to MODX 2.8.1 i get this error.
i checked the email adress and that is correct. Any idea what is going wrong?

RDG

I assume the error occurs here in the code.

Are the values for ‘From’, ‘Sender’ and ‘ConfirmReadingTo’ all a valid email-address or empty?

Hi,
no there is no ConfirmReadingTo no idea what that is?
Any idea how i should add this?
right now i have:

       
        $modx->mail->address('to', $_POST['emailadres']);
        $modx->mail->address('reply-to', 'aanmeldingen@xxx.nl');

        $modx->mail->set(modMail::MAIL_FROM, 'aanmeldingen@xxx.nl');
        $modx->mail->set(modMail::MAIL_FROM_NAME, 'afzender naam');
        $modx->mail->set(modMail::MAIL_SENDER, 'Aanmeldformulier');
        $modx->mail->set(modMail::MAIL_SUBJECT, $subject);
        $modx->mail->set(modMail::MAIL_BODY, $message);

Try setting modMail::MAIL_SENDER to an email address (or maybe leave it empty).

Hi,
tnx yes that seemed to work. I don’t understand why because the script has always been the otherway and that worked

RDg