<gh_stars>0
# Copyright (c) 2015, <NAME>
# All rights reserved.

from nsmtp import *
import getpass

def send_test():
    username = "<EMAIL>"
    password = getpass.getpass("Password: ")

    user = User(username, password)

    sender = username
    to_list = ["<EMAIL>"]
    subject = "Email subject"
    body = """Hello, there!\nHow's it hangin'?\r\n.\r\n^  This dot should be visable."""

    body = format_message_body(sender, to_list, subject, body)
    msg = Message(sender, to_list, body)

    s = None
    try:
        s = MailSender('smtp.gmail.com', 465, debug=True)
    except MailError as e:
        print(e)
        return
        
    with s:
        try:
            s.authenticate(user)
            s.send_message(msg)
        except MailError as e:
            print(e)
            return

if __name__ == "__main__":
    send_test()


# Copyright (c) 2015, <NAME>
# All rights reserved.

from nsmtp import *
import getpass

def send_test():
    username = "<EMAIL>"
    password = getpass.getpass("Password: ")

    user = User(username, password)

    sender = username
    to_list = ["<EMAIL>"]
    subject = "Email subject"
    body = """Hello, there!\nHow's it hangin'?\r\n.\r\n^  This dot should be visable."""

    body = format_message_body(sender, to_list, subject, body)
    msg = Message(sender, to_list, body)

    s = None
    try:
        s = MailSender('smtp.gmail.com', 465, debug=True)
    except MailError as e:
        print(e)
        return
        
    with s:
        try:
            s.authenticate(user)
            s.send_message(msg)
        except MailError as e:
            print(e)
            return

if __name__ == "__main__":
    send_test()
# Copyright (c) 2015, <NAME> # All rights reserved. Hello, there!\nHow's it hangin'?\r\n.\r\n^  This dot should be visable.