Here is my properly working mail script and I need to add Subject line in this and also a Mysql data base connection and a query result in mail Body please help i am using MysqlDb module for connecting to database .

Code:
import smtplib
import urllib2
import MySQLdb


  
fromaddr = 'user@gmail.com'  
toaddrs  = ['user@gmail.com']  
msg = '!!Only test!!'  
  
  
# Credentials (if needed)  
username = 'user@gmail.com'  
password = 'password'  
  
# The actual mail send  
server = smtplib.SMTP('smtp.gmail.com:587')  
server.starttls()  
server.login(username,password)  
server.sendmail(fromaddr, toaddrs, msg)  
server.quit()