def email(message, to, username, password, domain, host, port):
    """
        to          : who to send notebook to
        username    : email account username
        password    : email account password
        domain      : email account provider
        host        : smtp host
        port        : smtp port
    """
    r = message.send(to=to, smtp={'host': host, 'port': port, 'ssl': True,
        'user': username, 'password': password})
    if r.status_code != 250:
        print(r)
        raise Exception('Email exception! Check username and password')
    return r
