We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53387
    • 2 Posts
    Hey.
    I use the same code to attach a file to a letter.

    $attachment = 'assets/....pdf';
    $basepath = $modx->getOption('base_path');
    $hook->modx->getService('mail', 'mail.modPHPMailer');
    $hook->modx->mail->mailer->AddAttachment($basepath.$attachment);        
    


    On my mail comes a letter with an attached file, and on the client's mail without.
    I then add this line

    $hook->modx->mail->address('to', $curEmail);
    


    And then the client receives two letters. With the attached file and without.
    Help me please.