Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'try:': 0.07; 'python': 0.09; 'nameerror:': 0.09; 'static': 0.13; 'constants': 0.16; 'makepy': 0.16; 'subject:Outlook': 0.16; 'subject:image': 0.16; 'mon,': 0.16; 'wrote:': 0.17; 'library,': 0.17; 'module': 0.19; 'assuming': 0.22; 'defined': 0.22; 'example': 0.23; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; '(most': 0.27; 'message-id:@mail.gmail.com': 0.27; 'outlook': 0.28; 'run': 0.28; "skip:' 10": 0.30; 'traceback': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'similar': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'skip:w 30': 0.61; "you've": 0.61; 'subject:, ': 0.61; 'jul': 0.65; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=2SXT1yv/D+ZBNhyW/EbGyKHQKkHBwKZdLYbKTYikB38=; b=e2QnbQQNuDoczXwaDtNW1vxzRm5qL2x3NqVD+lwJyQKOueSfNJJUyrjvQrgjOVIRVb 5fjsxm+zDdY3uPJYQloJGMGDddalgjWadziBvWJZAA8CWYy6QtdasIMSiJW9IFfhLd// elFXVPyDZEzRT61pqxQm8whW199bcgG2F2oLUWmsDKaNWnH1NdE05inK0T6BjUsY/QyW Nv5f2o2d3erei+Zn8WYCVJtQiuam5GnBuMikxTRuoILOagc7UOYkGYaonOf7fIJntRAM AdwnCOB16LKXk9CwdI0hCXZ5o2gRKCFqDoeqpuxxErHneCKPtdFKRHR/Gg/qifxygG41 y3yw== MIME-Version: 1.0 In-Reply-To: <22e9b14a-d660-4ec9-a67b-0fcdc9ef1463@googlegroups.com> References: <641dab69-9782-4bf3-8a01-34237c4f189a@googlegroups.com> <22e9b14a-d660-4ec9-a67b-0fcdc9ef1463@googlegroups.com> From: Ian Kelly Date: Mon, 23 Jul 2012 14:32:36 -0600 Subject: Re: Python and Outlook, sendinf an image in the body of email To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1343075588 news.xs4all.nl 6931 [2001:888:2000:d::a6]:50466 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:25919 On Mon, Jul 23, 2012 at 12:33 PM, wrote: > I tried something similar to the example at http://stackoverflow.com/questions/4312687/how-to-embed-images-in-email . > > Problem is, this line is not understood: > mail.BodyFormat = OlBodyFormat.olFormatHTML > > Traceback (most recent call last): > ... > appt.BodyFormat = OlBodyFormat.olFormatHTML > NameError: name 'OlBodyFormat' is not defined Assuming you've run makepy to generate the static dispatch Python module for the Outlook type library, all generated constants are available via win32com.client.constants Try: appt.BodyFormat = win32com.client.constants.olFormatHTML