Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

outlook application_itemsend

Status
Not open for further replies.

mfulbright

IS-IT--Management
Apr 13, 2009
3
we have a strict email policy and all emails must go through a manager before being sent out. i am in process of setting up a Windows XP laptop with Office XP to move the original "To" email address to the subject line and change the "To" address to the user's manager, e.g.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.Subject = Item.Subject + Item.To
Item.To = "manager@company.com"
End Sub

Upon Send the message is updated and saved to Sent Items like it was sent but the message is never actually sent. any ideas?
 
You should use the & symbol to join text and you need to call the Recipients.ResolveAll event before the mail can be 'sent' to the Exchange Server (otherwise you get an Undeliverable response)

Try this:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Item.Subject = Item.Subject & " To:" & Item.To
Item.To = "manager@company.com"
Item.Recipients.ResolveAll
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top