Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"From" field in the mailitem

1,062 views
Skip to first unread message

Prashant Shah

unread,
Jan 29, 2008, 12:25:12 PM1/29/08
to
Res. All
Can I get/set the "From" field of a new mailitem?
Thanks in advance

Prashant


Prashant Shah

unread,
Jan 29, 2008, 12:25:12 PM1/29/08
to

Sue Mosher [MVP-Outlook]

unread,
Jan 29, 2008, 1:08:22 PM1/29/08
to
Outlook 2007 adds a MailItem.SendUsingAccount property.

For earlier versions, Outlook provides no direct way to change the account for an outgoing message. These are known workarounds using native Outlook functionality:

1) If the user has Outlook 2002/3 and is not using WordMail as the editor, you can set the sending account using CommandBars techniques. See http://www.outlookcode.com/codedetail.aspx?id=889 for sample code.

2) In an Exchange environment where you want to use another user's mailbox as the From address, set the MailItem.SentOnBehalfOfName property. If you do not want the current user's name to appear in the message at all, the Exchange administrator must grant Send As permission on the other user's mailbox.

Setting SentOnBehalfOfName technique may also work when sending through SMTP accounts, but test first to see whether recipients will also see "on behalf of" information listing the actual sender name/address.

3) If you're mainly concerned about replies to your message going to the correct place, add the desired reply address to the MailItem.ReplyRecipients collection.

The third-party Redemption ( http://www.dimastr.com/redemption/ ) library adds two other solutions:

4) Set an RFC822 header property, as described at http://www.dimastr.com/redemption/faq.htm#14

5) Set the RDOMail.Account property, as described at http://www.dimastr.com/redemption/rdo/RDOMail.htm


--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Prashant Shah" <dr_pra...@hotmail.com> wrote in message news:uqSNivpY...@TK2MSFTNGP03.phx.gbl...

0 new messages