A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Setting account for an outgoing email



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 19th 07, 11:10 PM posted to microsoft.public.outlook.program_vba
Markus
external usenet poster
 
Posts: 28
Default Setting account for an outgoing email

I am using OLE to call outlook in my app to send email. I see many
properties I can set, but not one that I can use to set the account (e.g.,
send via , or send via , etc.) that will be used
to send the email. I have 2 accounts set up in outlook now that I could
access.

Can anyone help on how outlook sets this account and how I would do it
programmatically before I send the email?

Many thanks for any ideas on this,
Mark
  #2  
Old July 20th 07, 02:39 AM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Setting account for an outgoing email

1. OOM in Outlook 2007 - MailItem.SendUsingAccount property
2. Extended MAPI (C++/Delphi only) - use IOlkAccountMgr to read the account
names/ids and set them on the message (look at a message with an account
info set using OutlookSpy - click IMessage)
3. plug RDOMail.Account property - see
http://www.dimastr.com/redemption/rdo/RDOMail.htm /plug

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

"Markus" wrote in message
...
I am using OLE to call outlook in my app to send email. I see many
properties I can set, but not one that I can use to set the account (e.g.,
send via , or send via , etc.) that will be
used
to send the email. I have 2 accounts set up in outlook now that I could
access.

Can anyone help on how outlook sets this account and how I would do it
programmatically before I send the email?

Many thanks for any ideas on this,
Mark



  #3  
Old March 29th 08, 04:46 AM posted to microsoft.public.outlook.program_vba
JHoep
external usenet poster
 
Posts: 2
Default Setting account for an outgoing email

Following along this logic, is there a way to use MailItem.SendUsingAccount
that will attempt to send the email via one account, but if that fails, to
use a second account that is set up in Outlook?
I currently have two accounts, one which works when I have my laptop at work
(through one SMTP server) and one which works at home (through a different
SMTP server). I am trying to avoid having to manually select the account
every time I am at the non-default account location.
Thanks for any assistance you can provide.
Jason

"Dmitry Streblechenko" wrote:

1. OOM in Outlook 2007 - MailItem.SendUsingAccount property
2. Extended MAPI (C++/Delphi only) - use IOlkAccountMgr to read the account
names/ids and set them on the message (look at a message with an account
info set using OutlookSpy - click IMessage)
3. plug RDOMail.Account property - see
http://www.dimastr.com/redemption/rdo/RDOMail.htm /plug

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

"Markus" wrote in message
...
I am using OLE to call outlook in my app to send email. I see many
properties I can set, but not one that I can use to set the account (e.g.,
send via , or send via , etc.) that will be
used
to send the email. I have 2 accounts set up in outlook now that I could
access.

Can anyone help on how outlook sets this account and how I would do it
programmatically before I send the email?

Many thanks for any ideas on this,
Mark




  #4  
Old March 29th 08, 10:30 AM posted to microsoft.public.outlook.program_vba
SvenC[_2_]
external usenet poster
 
Posts: 40
Default Setting account for an outgoing email

HI JHoep,

Following along this logic, is there a way to use
MailItem.SendUsingAccount that will attempt to send the email via one
account, but if that fails, to use a second account that is set up in
Outlook?


I guess the problem is that using the wrong account does not result
in a failure but will just keep the mail in the outbox until the smtp server
gets available, correct?

I currently have two accounts, one which works when I have my laptop
at work (through one SMTP server) and one which works at home
(through a different SMTP server). I am trying to avoid having to
manually select the account every time I am at the non-default
account location.


You might need to check the availability of some other resource, e.g.
a file on a network share which is only available when you are in your
work network. That should help to figure out which account to use.

--
SvenC

  #5  
Old March 29th 08, 01:10 PM posted to microsoft.public.outlook.program_vba
JHoep
external usenet poster
 
Posts: 2
Default Setting account for an outgoing email

Ok, I definitely can check for the existence of a network drive or other
shared file that would be accessible only at work. But how do I do that?
What would be the basic commands/syntax to have Outlook do the check and then
pick the account to send the email from (ideally this happens behind the
scenes when the "Send" button is pressed).
Thanks.
Jason

"SvenC" wrote:

HI JHoep,

Following along this logic, is there a way to use
MailItem.SendUsingAccount that will attempt to send the email via one
account, but if that fails, to use a second account that is set up in
Outlook?


I guess the problem is that using the wrong account does not result
in a failure but will just keep the mail in the outbox until the smtp server
gets available, correct?

I currently have two accounts, one which works when I have my laptop
at work (through one SMTP server) and one which works at home
(through a different SMTP server). I am trying to avoid having to
manually select the account every time I am at the non-default
account location.


You might need to check the availability of some other resource, e.g.
a file on a network share which is only available when you are in your
work network. That should help to figure out which account to use.

--
SvenC


  #6  
Old March 29th 08, 02:36 PM posted to microsoft.public.outlook.program_vba
SvenC[_2_]
external usenet poster
 
Posts: 40
Default Setting account for an outgoing email

Hi JHoep,

Ok, I definitely can check for the existence of a network drive or
other shared file that would be accessible only at work. But how do
I do that? What would be the basic commands/syntax to have Outlook do
the check and then pick the account to send the email from (ideally
this happens behind the scenes when the "Send" button is pressed).


I thought you wanted to do some macro programming.

When you want Outlook to automatically choose the accout you could
add some code in the ItemSend event of Outlook.Application. I am not
sure if you can change the account at this point but you can at least try
it.

--
SvenC

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting email account in Outlook Express Jerry the German Outlook Express 5 April 11th 07 03:37 PM
Setting up email account on laptop kate_exchange_novice Outlook - Installation 1 December 27th 06 05:25 PM
Email account not showing up in outgoing email Larry S. Outlook Express 3 August 3rd 06 08:51 PM
Setting up Netscape as Outlook email account? Gordon Outlook - General Queries 1 May 11th 06 05:38 PM


All times are GMT +1. The time now is 12:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.