Open Graham-72 opened 6 years ago
I didn't know about mailengines. This is a hot mess. So this is in addition to how Mailsystem manages things?
We should be careful not to hardcore assumptions into these modules. Someone might want to use a rest API to send email instead of SMTP too. For instance, someone might fork https://www.drupal.org/project/sparkpost or the Sendgrid equivalent. They are managed by Mailsystem.
Yes, this does all seem a bit confused/confusing!
As I understand it Mailsystem and Simple Mailsystem both give admin control of the linking of email sources to mail systems. To do this they contain a function that is there to identify the different mail systems available on the site, function &mailsystem_get_classes() and function &simple_mailsystem_get_options() respectively.
But it seems that Mimemail has a different mechanism for doing this (and calls them 'mail engines') relying on providing a hook (hook_mailengine) for each mail system to identify itself as a mail engine able to send mail. But this is not a recognised hook in Backdrop, for core or contributed modules. Consequently, as far as I can tell so far, Mimemail always sends its output to the Default Mail System, no others being identified.
In the particular case of Webform I am wondering whether there is any need to involve Mimemail because in testing with it linked to use the SMTP mailsystem the result seems to be in HTML format sent by PHPmailer in MIME format, without the Mimemail module's help with formatting.
I am going to keep testing various configurations.
It seems there's https://www.drupal.org/project/phpmailer which might use that hook created by MimeMail. And it's maintained by @oadaeh so he might be able to help us navigate this all!
More to my last point, I've made a port of phpmailer module: https://github.com/herbdool/phpmailer. Might be a better route to take than SMTP module. I'll move it to backdrop-contrib at some point soon.
I don't know if this is still an issue. I am able to send email via smtp by:
admin/config/system/mailsystem
select
admin/config/system/smtp
Mimemail implements a concept 'mailengine' but does not recognise the SMTP module as a possible mailengine, hence will not use it for sending mail.