Support » Plugin: Mail Bank - #1 Mail SMTP Plugin for WordPress » Mail Bank Doesn’t Include Attachment

  • Resolved fssbob

    (@fssbob)


    I use UpdraftPlus, a popular backup plugin. When an UpdraftPlus job completes, it sends a status email with the job log as an attachment. Mail Bank sends the status email, but without the attachment. Does Mail Bank support attachments at all?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Varun Sharma

    (@contact-banker)

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mail Bank Doesn’t Include Attachment’ is closed to new replies.