Luca wrote:
>
> Hi everybody, I’m trying to send an email via outlook and everything
> works fine with the following code:
>
>  
>
>         obj = win32com.client.Dispatch(/"Outlook.Application"/)
>
>         formail inLmail:           
>
>             newMail = obj.CreateItem(0)
>
>             newMail.To = mail
>
>             newMail.Subject = /"_Title_"/
>
>             newMail.Body = /"_CIAO_"/
>
>             newMail.Send()
>
>  
>
> Now I have to send an htm mail instead than normal plain text but I
> can’t find anything to do that.
>

Add:

    import win32con
    newMail.BodyFormat = win32con.olFormatHTML
    newMail.HTMLBody = "<html><body>CIAO!</body></html>"

All I did was go to the MSDN page on the CreateItem method of the
Outlook.Application object.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to