'Send an email notification
:param str message: message body
:param str title: message subject
:param dict config: email plugin config'

def notify(self, title, message, config):

    if (not isinstance(config[u'to'], list)):
        config[u'to'] = [config[u'to']]
    email = MIMEMultipart(u'alternative')
    email[u'To'] = u','.join(config[u'to'])
    email[u'From'] = config[u'from']
    email[u'Subject'] = title
    email[u'Date'] = formatdate(localtime=True)
    content_type = (u'html' if config[u'html'] else u'plain')
    email.attach(MIMEText(message.encode(u'utf-8'), content_type, _charset=u'utf-8'))
    if ((not self.mail_server) or (not ((self.host == config[u'smtp_host']) and (self.username == config.get(u'smtp_username'))))):
        self.connect_to_smtp_server(config)
    connection_error = None
    while True:
        try:
            self.mail_server.sendmail(email[u'From'], config[u'to'], email.as_string())
            break
        except (SMTPServerDisconnected, SMTPSenderRefused) as e:
            if (not connection_error):
                self.connect_to_smtp_server(config)
                connection_error = e
            else:
                raise PluginWarning((u'Could    not    connect    to    SMTP    server:    %s' % str(e)))
