我需要使用 python 在电子邮件中打印 HTML 文本并从变量中获取值。
我尝试使用以下内容,但在 htmlbody 部分它返回一个错误,并且它似乎只有在我将所有内容都输入为字符串时才有效,但我需要能够引用变量
import win32com.client
from win32com.client import Dispatch, constants
testo="Edoardo!!!"
const=win32com.client.constants
olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.Application")
newMail = obj.CreateItem(olMailItem)
newMail.Subject = "Test !!"
newMail.HTMLBody = ("Some text here<u>",---variable here---,"</u>Othertext")
newMail.To = "email@demo.com"
我能做些什么?先感谢您