Hi folks,
I've just been messing around for the last hour or two trying to get modMail working, using the rtfm page as my source. I was consistently getting "Could not instantiate mail function" errors in the log.
After checking and re-checking my code against the documentation, I eventually reverse-engineered my way through the modMailer class and found that it's actually the documentation at fault.
The page in question is
http://rtfm.modx.com/display/revolution20/modMail.
Line 7 of the "Usage" example calls for:
$modx->mail->set(modMail::MAIL_SENDER,'Johnny Tester');
The MAIL_SENDER field is used for the "From" email address,
not the name as it appears in the From field. This was causing numerous problems at the receiving MTA, so all my emails were returned undelivered.
So, as a quick fix, would someone with the appropriate authority (not me, it seems!) please update the modMail docs page.
Line 7 should probably be removed completely, because lines 5 and 6 render it redundant. And also because it is wrong, of course!
Cheers,
Russell