How to add email html as input for my code

23 Views Asked by At

I wrote a script that, when run, will sends emails in outlook that uses a standard email body

what if tried to do is just place the standard emails html body in different module called outlookmodule.py and then its run through a code that somewhat like the below and sends

but what I am trying to accomplish is for the code to accept input in the form of any other html format that can be used as the emails body instead of the standard body so that it can be used for other purposes.

import win32com.client as client
import outlookmodule

outlook = client.Dispatch("Outlook.Application")
body_var = outlookmodule.get_holiday_client()

message = outlook.CreateItem(0)
message.HTMLBody = body_var
message.Send()

I have tried using input() as a way to paste another html body using the command prompt but it doesnt seem to work so Im trying to find other ways to accomplish this.

if anyone has found other ways that work well for them it would be appreciated if I could see how its accomplished

0

There are 0 best solutions below