Hi,
Mail Bank does allow sending emails with attachments.
In case this sheds any light on it, this is how UD is adding the attachments, via a hook to phpmailer_init:
public function phpmailer_init($phpmailer) {
global $updraftplus;
if (empty($this->attachments) || !is_array($this->attachments)) return;
foreach ($this->attachments as $attach) {
$mime_type = (preg_match('/\.gz$/', $attach)) ? 'application/x-gzip' : 'text/plain';
try {
$phpmailer->AddAttachment($attach, '', 'base64', $mime_type);
} catch (Exception $e) {
$updraftplus->log("Exception occurred when adding attachment (".get_class($e)."): ".$e->getMessage());
}
}
}
However, mail bank or any popular smtp plugin won’t use phpmailer_init hook.
This is the reason you are facing the issue.
You may consult Updraft Plus for a solution.
Thanks
Support Team
Tech Banker
Thread Starter
fssbob
(@fssbob)
Thanks for the quick response.
1) Re “You may consult Updraft Plus for a solution”: I’ve already been through that with UpdraftPlus with the Postman SMTP plugin, which as you state has the same problem. (I’m looking at alternatives to replace it since it appears to have been abandoned by its developer.) UpdraftPlus says this is a defect in Postman SMTP. They believe that using phpmailer_init to add attachments is legitimate and should be supported by an SMTP plugin. For Postman SMTP, I was able to work around this by creating a plugin that added the attachment via the wp_mail filter, which Postman SMTP supports:
$atts = apply_filters ( 'wp_mail', compact ( 'to', 'subject', 'message', 'headers', 'attachments' ) );
It doesn’t appear to me that you support this filter. Is that correct?
2) Do you support attachments from the popular Forms products: Gravity Forms, Ninja Forms, and WPForms?
Thanks.