From Field

  • Thread starter Thread starter ysut
  • Start date Start date
Y

ysut

I have another mailbox which delegated to my account. Let's say th
mailbox is Ysut2. In manualy way, I can change the From field to YSUT
everytime I want to sent a newmail.
But, how to change with VBA ?

Please help me. Thank yo
 
Dmitry,
Outlook 2000, two accounts:
(e-mail address removed) (Default mail account)
(e-mail address removed)

I have tried what you suggested. I use this macro:

Dim msgMail As MailItem
Set msgMail = Application.CreateItem(olMailItem)
With msgMail
.SentOnBehalfOfName = "(e-mail address removed)"
.Display
End With

When the form displays, it has my secondary account in the FROM textbox ([email protected]), but when sent the message goes out using the primary account. When the reciepient receives the message, it is FROM the default mail account (e-mail address removed).

Any idea what I may have missed?
Thanks,
msc

Dmitry Streblechenko said:
Use MailItem.SentOnBehalfOfName property

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
SentOnBehalfOfName is Exchange specific. If you are using POP3/SMTP account,
there is no way to select an account. The only workaround I am aware of is
http://www.dimastr.com/redemption/faq.htm#14

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dmitry,
Outlook 2000, two accounts:
(e-mail address removed) (Default mail account)
(e-mail address removed)

I have tried what you suggested. I use this macro:

Dim msgMail As MailItem
Set msgMail = Application.CreateItem(olMailItem)
With msgMail
.SentOnBehalfOfName = "(e-mail address removed)"
.Display
End With

When the form displays, it has my secondary account in the FROM textbox
([email protected]), but when sent the message goes out using the
primary account. When the reciepient receives the message, it is FROM the
default mail account (e-mail address removed).

Any idea what I may have missed?
Thanks,
msc

Dmitry Streblechenko said:
Use MailItem.SentOnBehalfOfName property

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Well that's it then, no exchange here
thanks!
msc
Dmitry Streblechenko said:
SentOnBehalfOfName is Exchange specific. If you are using POP3/SMTP account,
there is no way to select an account. The only workaround I am aware of is
http://www.dimastr.com/redemption/faq.htm#14

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dmitry,
Outlook 2000, two accounts:
(e-mail address removed) (Default mail account)
(e-mail address removed)

I have tried what you suggested. I use this macro:

Dim msgMail As MailItem
Set msgMail = Application.CreateItem(olMailItem)
With msgMail
.SentOnBehalfOfName = "(e-mail address removed)"
.Display
End With

When the form displays, it has my secondary account in the FROM textbox
([email protected]), but when sent the message goes out using the
primary account. When the reciepient receives the message, it is FROM the
default mail account (e-mail address removed).

Any idea what I may have missed?
Thanks,
msc
 
Back
Top