I am playing a bit with sending messages to outlook in python and i want to text if i cant send parameters in the mail. my paramater is a a string called "text" as it is written in the code down below and i am trying to get the value printed in the outlook mail.
this is the code:
for example:
from ast import Param
from email.message import Message
import json
import urllib.request
import argparse
from win32api import MessageBoxEx
from win32com.client import Dispatch, GetObject
from pathlib import Path
from datetime import datetime
import smtplib
from email.mime.text import MIMEText
import os
import pathlib
import win32com.client as client
from colorama import Back,Style,Fore
outlook=client.Dispatch("Outlook.Application")
message=outlook.createitem(0)
message.display()
message.To="barney@skylinesoft.com"
message.subject = "happy birthday"
message.body = "wishing you"
text="wloasdlfkjasldkfjasf"
message.HTMLBody = "<b> wishing you </b>"
html_body = """
<div>
<h1 style="font-family: 'Lucida Handwriting'; font-size: 56; font-weight: bold; color: #9eac9c;">
Happy Birthday!!
</h1>
<span style="font-family: 'Lucida Sans'; font-size: 28; color: #8d395c;">
{text}
</span>
</div><br>
<div>
<img src="https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/cute-birthday-instagram-captions-1584723902.jpg" width=50%>
</div>
"""
message.HTMLBody = html_body
the "text" paramater does not the display in the mail i send the string that is stored in the paramater. it displays in the mail "text" am i doing it wrong or is it just not possible?