Need to include inline signature having a image and some links while sending mail

While sending mail I want to include signature inline to each of the mail. The whole signature include an image with few links. Its somewhat like this:http://imgur.com/ZqV3HxG

Below is the code :
import smtplib,ssl
import email.utils
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from xlrd import open_workbook, xldate_as_tuple
from datetime import date
import os

input_file = “sample.xlsx”

context = ssl.create_default_context()
server = smtplib.SMTP_SSL(host=‘smtp.gmail.com’,port= 465,context=context)
server.login(‘username@gmail.com’,‘password’)
subject = “Test Subject”
fromaddr=‘username@gmail.com’

with open_workbook(input_file) as workbook:
worksheet = workbook.sheet_by_name(‘sample1’)

for row_index in range(1, worksheet.nrows):
	name = worksheet.cell_value(row_index, 0)
	toaddr = worksheet.cell_value(row_index, 1)
	msg = MIMEMultipart()
	text = "Dear "+str(name)+ ",\nThanks for your valuable sugestions. \nSincere Regards,\n"+"""\
	<html>
		<body>
			<p>a href="https://www.python.org/">Python</a></p>
		</body>
	</html>
	"""
    

	msg['To'] = toaddr

	msg['From'] = email.utils.formataddr(('myName', fromaddr))

	msg['Subject'] = subject
	part1 = MIMEText(text)
	#part2 = MIMEText(html, 'html')
	msg.attach(part1)
	#msg.attach(part2)
	server.sendmail(fromaddr, toaddr, msg.as_string())                        

print(“Emails sent successfully”)
server.quit()

I’ve tried to include html part, but its not working. Any suggestions?

Hi Soupratick Manna, and welcome,

“I’ve tried to include html part, but its not working. Any suggestions?”

Please tell us what “its not working” means. There is exactly one way it
actually does work, and about a million ways it could “not work”. Which
is it?

It will help us to help you if you start by reading these links:

Remember that we cannot run your code: we don’t have access to your
sample file, or your Gmail account, and even if we did, we shouldn’t
have to run your code to know what is not working.

By the way, the only way to get the sort of inline image and hyperlinks
you are trying to get is with HTML mail. And you really should include a
plain text version for those who cannot or will not display HTML. You
should start by making sure you can send a plain text version, with no
attached image, and only when that part is working, add a second HTML
attachment part.