Microsoft KB Archive/823917

= Recipients do not receive your e-mail message when you set the Recipients.Type property to olOrignator (0) in Outlook =

Article ID: 823917

Article Last Modified on 1/24/2007

-

APPLIES TO


 * Microsoft Office Outlook 2003
 * Microsoft Outlook 2002 Standard Edition
 * Microsoft Office Outlook 2007

-



SYMPTOMS
When you programmatically send an e-mail message to more than one recipient, the recipients do not receive your e-mail message, and you receive an undeliverable e-mail message that is similar to the following:

Undeliverable:

Your message did not reach some or all of the intended recipients.

Subject:

Sent:

The following recipient(s) could not be reached:

 on

This message could not be sent. Try sending the message again later, or contact your network administrator. Error is [0x80070057-00000000-00000000].

 on

This message could not be sent. Try sending the message again later, or contact your network administrator. Error is [0x80070057-00000000-00000000].



CAUSE
This behavior may occur when the Recipient .Type property is set to 0 for one or more of your recipients.

For example, this behavior may occur if you run a Microsoft Visual Basic for Applications (VBA) macro that is similar to the following example: Sub TestTypeMailItem

Dim mai As MailItem Dim rcps As Recipients Dim rcp As Recipient Set mai = Application.CreateItem(olMailItem) mai.Subject = &quot;Recipient.Type&quot; Set rcps = mai.Recipients

Set rcp = rcps.Add(Application.Session.CurrentUser.Name) rcp.Type = 0

'Change &quot;e-mail address&quot; to a valid e-mail address. Set rcp = rcps.Add(&quot;e-mail address&quot;) rcp.Type = 1

'Change &quot;e-mail address&quot; to a valid e-mail address. Set rcp = rcps.Add(&quot;e-mail address&quot;) rcp.Type = 0

mai.Send

End Sub



RESOLUTION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

To resolve this behavior, change the Recipient .Type property for your recipients to one of the following properties:
 * Use Recipient. Type property 1 for recipients that are included in the To box of the e-mail message.
 * Use Recipient. Type property 2 for recipients that are included in the Cc box of the e-mail message.
 * Use Recipient Type property 3 for recipients that are included in the Bcc box of the e-mail message.

For example, change the Recipient .Type property in your VBA macro as demonstrated in the following sample code: Sub TestTypeMailItem

Dim mai As MailItem Dim rcps As Recipients Dim rcp As Recipient Set mai = Application.CreateItem(olMailItem) mai.Subject = &quot;Recipient.Type&quot; Set rcps = mai.Recipients

Set rcp = rcps.Add(Application.Session.CurrentUser.Name) rcp.Type = 1

'Change &quot;e-mail address&quot; to a valid e-mail address. Set rcp = rcps.Add(&quot;e-mail address&quot;) rcp.Type = 2

'Change &quot;e-mail address&quot; to a valid e-mail address. Set rcp = rcps.Add(&quot;e-mail address&quot;) rcp.Type = 3

mai.Send

End Sub

Additional query words: OL2003 OL2007

Keywords: kberrmsg kbvba kbemail kbpending kbprb KB823917

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.