# Path: bamboo/lib/mail.py
# def send_mail(smtp_server, mailbox_name, mailbox_password, recipient, sender,
#               subject, body):
#     msg = __format_message(recipient, sender, subject, body)
# 
#     server = smtplib.SMTP(smtp_server, 587)
#     server.ehlo()
#     server.starttls()
#     server.ehlo()
#     server.login(mailbox_name, mailbox_password)
#     server.sendmail(sender, recipient, msg)
#     server.close()


import cherrypy
from bamboo.lib.mail import send_mail



ERROR_RESPONSE_BODY = """
    <html><body><p>Sorry, an error occured. We are working to resolve it.
    </p><p>For more help please email the <a
    href= 'https://groups.google.com/forum/#!forum/bamboo-dev'>bamboo-dev
    list</a></p></body></html>"""


def handle_error():
    cherrypy.response.status = 500
    cherrypy.response.body = [ERROR_RESPONSE_BODY]

# Path: bamboo/lib/mail.py
# def send_mail(smtp_server, mailbox_name, mailbox_password, recipient, sender,
#               subject, body):
#     msg = __format_message(recipient, sender, subject, body)
# 
#     server = smtplib.SMTP(smtp_server, 587)
#     server.ehlo()
#     server.starttls()
#     server.ehlo()
#     server.login(mailbox_name, mailbox_password)
#     server.sendmail(sender, recipient, msg)
#     server.close()


# Path: bamboo/controllers/root.py
import cherrypy
from bamboo.lib.mail import send_mail




ERROR_RESPONSE_BODY = """
    <html><body><p>Sorry, an error occured. We are working to resolve it.
    </p><p>For more help please email the <a
    href= 'https://groups.google.com/forum/#!forum/bamboo-dev'>bamboo-dev
    list</a></p></body></html>"""


def handle_error():
    cherrypy.response.status = 500
    cherrypy.response.body = [ERROR_RESPONSE_BODY]

    send_mail('smtp.googlemail.com', 'bamboo.errors', 'test-password',