def METHOD_NAME(self):
    if not Template:
        raise MissingDependencyError("jinja2")
    if self.ssl:
        self.smtp_class = smtplib.SMTP_SSL
    else:
        self.smtp_class = smtplib.SMTP
    if not self.mail_from:
        raise ConfigurationError("Mail", "No sender specified")
    if not self.mail_to:
        raise ConfigurationError("Mail", "No recipient specified")
    if self.username and not self.password:
        raise ConfigurationError("Server", "SMTP username provided, but not password")
    if self.password and not self.username:
        raise ConfigurationError("Server", "SMTP password provided, but not username")
    self.smtp_authentication = self.username and self.password
    self.templates = {
        "subject": Template(self.subject),
        "from": Template(self.mail_from),
        "to": Template(self.mail_to),
        "body": Template(self.body),
    }
    for tmpl in self.templates.values():
        tmpl.globals.update({"from_json": json.loads})
    self.templates["attachments"] = []
    for att in self.attachments:
        if "content-type" not in att:
            self.logger.error("Attachment does not have a content-type, ignoring: %s.", att)
            continue
        elif "text" not in att:
            self.logger.error("Attachment does not have a text, ignoring: %s.", att)
            continue
        elif "name" not in att:
            self.logger.error("Attachment does not have a name, ignoring: %s.", att)
            continue
        attachment_template = {
            "content-type": Template(att["content-type"]),
            "text": Template(att["text"]),
            "name": Template(att["name"])
        }
        for tmpl in attachment_template.values():
            tmpl.globals.update({"from_json": json.loads})
        self.templates["attachments"].append(attachment_template)