Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Neil Newsgroups: comp.databases.ms-access Subject: Re: Access 2013 and sending an email. Date: Fri, 03 Oct 2014 01:05:22 -0500 Organization: A noiseless patient Spider Lines: 31 Message-ID: <542E3CA2.6040005@gmail.com> References: <076e8a04-1f71-4d6a-a933-357b195bf2b0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: mx05.eternal-september.org; posting-host="9768a1193dc012cfc531ce57a9e79a74"; logging-data="9627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18kaNSH5k8RSL6ybq4Awvst" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 In-Reply-To: <076e8a04-1f71-4d6a-a933-357b195bf2b0@googlegroups.com> Cancel-Lock: sha1:IKYq9SCndHdIQxgDOtd0i6nMQTo= Xref: csiph.com comp.databases.ms-access:9962 On 10/2/2014 12:59 PM, Patrick Finucane wrote: > I'm getting something goofy when I automate an email from Access 2013. Outlook is not open at this point. I press a command button on the form to send an email. The code assigns the email elements (Subject, attachment, To, etc) correctly and displays the email prior to sending. All is good at this point. I then press the SEND buttonin Outlook and the email closes. My code looks like this > If DisplayEmail Then > .Display > Else > .Save > .Send > End If > > After pressing the Send button in Outlook, the Outlook email message is closed. I am sending the message to myself for testing. I will wait forever and no message appears in my inbox. The message will ONLY appear when I open up Outlook. It seems doing so releases the message. > > How can I send an email when Outlook is closed initially? I assume I don't have a property setting set correctly. > Patrick, Where are you looking for the message? If Outlook isn't opened (and only the Outlook Message is displayed), then how would you know whether you've received it or not? Are you using another e-mail reader to look for the message? Looking for it online? Also, when happens if DisplayEmail is False? Does the code send the e-mail OK? Or is it not sent with that option either? For me, whenever I automate Outlook, I create an application object and then the message object, rather than just creating a new message directly. I find that that works better, but YMMV. Also, if the user already has Outlook open, I can just get that instance and use it, instead of opening a new instance. Neil