[AccessD] Email Automation to Outlook problem

Heenan, Lambert Lambert.Heenan at AIG.com
Wed Nov 29 16:15:04 CST 2006


Hmm.

I notice you are directly assigning the email address to the Item.To field.
No idea why this might suddenly stop working, but as it happens this is
*not* how I address emails. 

Instead I create an Outlook Mail Item...

    Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

...and then add an email address to the collection...

    With objOutlookMsg
         ' Add the To recipient(s) to the message.
          .Recipients.Add("Foo at bar.com") ' add an email address to the
collection

... and define the recipient type ...

          .Recipients.Type = olTo

... and lastly the address is verified using the Resolve method - this will
verify Exchange Server addresses.

        ' Resolve each Recipient's name.
        For Each objOutlookRecip In .Recipients
            If Not objOutlookRecip.Resolve = True Then
                MsgBox "Address " & objOutlookRecip.Name & " does not exist"
                objOutlookRecip.Delete
            End If
        Next
       ...
  End With

I have similar code that takes a delimited list of addresses and adds them
one by one to the Recipients collection.

This "works for me", and has done for years. Currently I'm using it with
Outlook XP (2002).

HTH

Lambert

-----Original Message-----


From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Myke Myers
Sent: Wednesday, November 29, 2006 4:23 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Email Automation to Outlook problem


I don't seem to be able to get rid of the apostrophes around the email
address.

Per Susan H.'s recommendation, I added brackets:
	itm.To = "<" & strEmailAddr & ">"

Still shows up in Outlook with apostrophes and no brackets.

Maybe this is some spam-fighting patch in Outlook implemented by Microsoft
recently.

It is causing big trouble for my client (and me).

Myke

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Mark A Matte
Sent: Wednesday, November 29, 2006 3:24 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Email Automation to Outlook problem


I am actually having a related issue right now.  I have a db that imports 
data every 30 minutes...does an analysis...and emails results using outlook.

  It worked fine for a year...and now outlook crashes almost everytime with 
"An unknown Error".  If I execute the exact same code from a button instead 
of a timer, it runs fine...I'm lost at this time.  I need a way to send an 
email without using outlook...I guess?

Thanks,

Mark A. Matte

>From: "Gustav Brock" <Gustav at cactus.dk>
>Reply-To: Access Developers discussion and problem 
>solving<accessd at databaseadvisors.com>
>To: <accessd at databaseadvisors.com>
>Subject: Re: [AccessD] Email Automation to Outlook problem
>Date: Wed, 29 Nov 2006 18:09:03 +0100
>
>Hi Susan and Chris
>
>Oh, that's another story - I don't use Outlook - so I cannot help.
>Could it be an automatic Windows Updating issue?
>
>/gustav
>
> >>> ssharkins at setel.com 29-11-2006 17:40:32 >>>
>Gustav,
>
>	This is something that Outlook seems to do on its own -- at least on

>my system. An address that's worked for years will suddenly not send.
>In the header, I can see the apostrophes. I delete the address, 
>re-enter it, and 9 times out of 10, it goes. No clue...
>
>	In my case, there's no code involved -- this is all Outlook.
>
>Susan H.
>
>The obvious solution is to adjust your code to stop wrapping the
>address in apostrophes. If, for some reason, that can't be done, change 
>these to brackets like:
>
>   <johndoe at aol.com>
>
>--
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com

_________________________________________________________________
Talk now to your Hotmail contacts with Windows Live Messenger. 
http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get
.live.com/messenger/overview

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list