We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42042
    • 140 Posts
    Hi All,

    I'm figuring out how to mail with the API of Modx. Not that familiar with PHP but getting there! I believe that Swift is faster and more secure than the phpmail function so I downloaded the extra, although its from 2011.. (maybe update swift classes manually?

    The thing is, it's working fine but I get some errors in my log and don't know if they are harmful or not. Do you guess shed some light on it?

    Many many thanks!

    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/model/modx/mail/modswiftmailer.class.php : 57) PHP warning: Declaration of modSwiftMailer::header($header, $value, $parameters = Array, $override = true) should be compatible with modMail::header($header)
    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/model/modx/mail/modswiftmailer.class.php : 57) PHP warning: Declaration of modSwiftMailer::send() should be compatible with modMail::send(array $attributes = Array)
    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/model/modx/mail/modswiftmailer.class.php : 57) PHP warning: Declaration of modSwiftMailer::reset($headers = true) should be compatible with modMail::reset(array $attributes = Array)
    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/model/modx/mail/modswiftmailer.class.php : 951) modSwiftMailer is missing a Return-Path
    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/model/modx/mail/modswiftmailer.class.php : 960) PHP warning: key() expects parameter 1 to be array, null given
    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/model/modx/mail/modswiftmailer.class.php : 961) PHP warning: key() expects parameter 1 to be array, null given
    [2016-11-04 09:09:00] (ERROR @ /xx/xx/xx/xx/core/cache/includes/elements/modsnippet/73.include.cache.php : 42) The mail was sent.

    This question has been answered by ilja-web. See the first response.

    • discuss.answer
      • 42042
      • 140 Posts
      If anyone sees this errors, don't use the extra. Cost me some time to debug but it screw up my hooks.

      I had for example: &hooks=`spam, FormItAutoResponder, email , CUSTOM HOOK(with swiftmailer), redirect` and everything after my custom hook didn't fire. I'd switched to modmail and everything is working now..

      Hope to save somebody some time!