I'm developing a Python scripts to create a simple AppointmentItem and send it to some recipients using win32com library. I found all the documentation and some VBA examples in this link: https://msdn.microsoft.com and everything seems to be clear and well exained. But, in my script, though the AppointmentItem is created and the Recipients resolved, I am not able to send it. The following is just an example of how looks the code.
outlook = win32com.client.Dispatch("Outlook.Application")
ns = outlook.GetNamespace("MAPI")
ns.Logon(profilename)
App = outlook.CreateItem(1)
App.Subject = "subject"
App.Body = "Meeting"
App.Location = "München"
App.Recipients.Add(recipient)
App.Recipients.ResolveAll()
App.Send()
Should I have necessarily an Exchange Account? Is there a workaround to avoid this problem? I can send normal email using this library using:
Msg = outlook.CreateItem(0)
instead of creating an appointment (fourth line). I tried, for this reason, to send an email with the appointment in attachment, but in the email there is no attachment.