Python and Outlook, sendinf an image in the body of email

bruceg113355 at gmail.com bruceg113355 at gmail.com
Mon Jul 23 19:19:40 CEST 2012


All,

I am trying to figure out how to send a image in the body of a email when Making a Meeting Request.
Below is my current code.

Thanks,
Bruce


# code below is mainly from http://harunprasad.blogspot.com/2012/01/python-make-meeting-request-appointment.html
# --------------------------------------------------------------------------------------------------------------

import win32com.client
oOutlook = win32com.client.Dispatch("Outlook.Application")
appt = oOutlook.CreateItem(1) 
appt.Start = '2012-07-24 08:00'
appt.Subject = '5th Meeting'
appt.Duration = 60
appt.Location = 'Conference Room, Main'


appt.Body = "This is body text\n"
attach1 = "someimage.jpg"
appt.Attachments.Add (attach1)        #prefer to have attachment inline (body) of email

appt.MeetingStatus = 1 

appt.Recipients.Add("someone at email.com") #enter valid email here

appt.Save()
appt.Send()

print "Done"





More information about the Python-list mailing list