Python uses SMTP to send mail to outlook mailbox without aligning the text format

In my local, I want to send the content of a text to another colleague's outlook mailbox. When I view the text locally, the content in the text is aligned, but it is not aligned when I send it to the outlook mailbox. How can I make the text sent to outlook the same as the alignment format in the original text?

In addition, how to adjust the font size of the text sent to outlook?

My code is as follows:


# -*- coding: UTF-8 -*-

import smtplib
import time
from email.mime.text import MIMEText
from email.utils import formataddr

#SMTP server address and port
smtp_server = ''
tls_port = '587'

#sender address and password
sender = ''
password = '123456789'

#recipient address
recipient = ''

month = time.strftime("%m",time.localtime())

f = open("/Users/asd/Desktop/test.txt",'r',encoding='utf-8')
bill_cost = ''' '''
while True:
    line = f.readline()
    bill_cost += line.strip()+'\n'
    if not line:

msg = MIMEText(bill_cost,'plain','utf-8')
msg['From'] = formataddr(["lrving",sender])
msg['To'] = formataddr(["jack",recipient])
msg['Subject'] = f"Bill statistics of each account in {month} 2021"

#SMTP use TLS send mail
server = smtplib.SMTP(smtp_server, tls_port)
server.login(sender, password)
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum