backdrop-contrib / smtp

Backdrop CMS port of the SMTP module for Drupal 7
GNU General Public License v2.0
4 stars 5 forks source link

Enable SMTP to be used with Mimemail module. #8

Open Graham-72 opened 6 years ago

Graham-72 commented 6 years ago

In the Mimemail contrib module there is an admin setting to select its 'mail engine', i.e. the module used for sending emails. If this SMTP module is set to be the default mail system for the site then Mimemail mail will be sent this way. But it may be a requirement for other reasons that the default mail system is not SMTP.

Mimemail relies on hook_mailengine to identify possible alternative sending mail systems. It would be good to make SMTP one of the options by implementing the hook as function smtp_mailengine(), then the outgoing mail from Mimemail could be set to use SMTP whatever the default mail system is set to be.

This could then also be used in mail system administration. Please see comment at https://github.com/backdrop-contrib/mailsystem/issues/1.

jenlampton commented 6 years ago

Backdrop (and Drupal) core only allow a single mail engine to be used. Right now that value is stored as a config value, which can be overridden by any contrib module. Core uses one mail system, MimeMail uses another, SMTP uses yet another. Combining the use of multiple mail systems has always been problematic in Drupal. I'd love to see a cleaner solution in Backdrop (core) if possible.

Until then, I'd support a PR that adds an implementation of hook_mailengine() directly into SMTP.