backdrop-contrib / mimemail

Mime Mail provides functions for other modules to use to send HTML mail.
GNU General Public License v2.0
0 stars 5 forks source link

Mimemail not sending via SMTP module #13

Open Graham-72 opened 6 years ago

Graham-72 commented 6 years ago

Mimemail implements a concept 'mailengine' but does not recognise the SMTP module as a possible mailengine, hence will not use it for sending mail.

herbdool commented 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.

Graham-72 commented 6 years ago

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.

herbdool commented 6 years ago

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!

herbdool commented 6 years ago

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.

argiepiano commented 1 year ago

I don't know if this is still an issue. I am able to send email via smtp by:

  1. Enable SMTP, Mimemail and Mailsystem
  2. In admin/config/system/mailsystem select
    • Delivery: SMTP Authentication
    • Formatting: Mime Mail
  3. Be sure to configure SMTP correctly at admin/config/system/smtp