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

VBA to Send message from a named Mailbox



 
 
Thread Tools Search this Thread Display Modes
  #11  
Old November 26th 07, 06:13 PM posted to microsoft.public.outlook.program_vba
Robin9876
external usenet poster
 
Posts: 10
Default VBA to Send message from a named Mailbox

Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.

On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:
Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.

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

"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?


"Robin9876" wrote in ...
As another workaround, can the Outlook Mail Profile be selected in
code and therefore is only one account to send as.


On 23 Nov, 14:18, "Sue Mosher [MVP-Outlook]"
wrote:
No, for that scenario, you'd need to set the actual send account. 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 set the sending account using CommandBars techniques. Seehttp://www.outlookcode.com/codedetail.aspx?id=889forsamplecode.


2) 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 another solutions:


3) Set the RDOMail.Account property, as described athttp://www.dimastr.com/redemption/rdo/RDOMail.htm


"Robin9876" wrote in ...
I have now found out more details to the original scenario. The
default account is an Exchange Mailbox and the other account is a non-
Exchange mailbox hosted elsewhere on the WAN. Both can be configured
in Outlook.


Would the above suggestion when sending on behalf route the message
via that mail connection or go via the default?


On 22 Nov, 16:23, "Sue Mosher [MVP-Outlook]"
wrote:
Set the SentOnBehalfOfName property of the outgoing message to the mailbox alias.


"Robin9876" wrote in ...
In VBA code (from Access) what is required to create and send mail via
Outlook from a named Exchange Mailbox, where there are more than 1
Exchange Mailboxes configured in Outlook?


Ads
  #12  
Old November 27th 07, 04:56 PM posted to microsoft.public.outlook.program_vba
Robin9876
external usenet poster
 
Posts: 10
Default VBA to Send message from a named Mailbox

Do you know what happens if you already have Outlook open on the pc
and then use CDO to send a message from another VBA application?

On 26 Nov, 17:13, Robin9876 wrote:
Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.

On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:

Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.


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


"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?


"Robin9876" wrote in ...
As another workaround, can the Outlook Mail Profile be selected in
code and therefore is only one account to send as.


On 23 Nov, 14:18, "Sue Mosher [MVP-Outlook]"
wrote:
No, for that scenario, you'd need to set the actual send account. 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 set the sending account using CommandBars techniques. Seehttp://www.outlookcode.com/codedetail.aspx?id=889forsamplecode.


2) 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 another solutions:


3) Set the RDOMail.Account property, as described athttp://www.dimastr.com/redemption/rdo/RDOMail.htm


"Robin9876" wrote in ...
I have now found out more details to the original scenario. The
default account is an Exchange Mailbox and the other account is a non-
Exchange mailbox hosted elsewhere on the WAN. Both can be configured
in Outlook.


Would the above suggestion when sending on behalf route the message
via that mail connection or go via the default?


On 22 Nov, 16:23, "Sue Mosher [MVP-Outlook]"
wrote:
Set the SentOnBehalfOfName property of the outgoing message to the mailbox alias.


"Robin9876" wrote in ...
In VBA code (from Access) what is required to create and send mail via
Outlook from a named Exchange Mailbox, where there are more than 1
Exchange Mailboxes configured in Outlook?


  #13  
Old November 27th 07, 06:34 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA to Send message from a named Mailbox

Nothing in particular happens. CDO for Windows doesn't use Outlook in any way.

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


"Robin9876" wrote in message ...
Do you know what happens if you already have Outlook open on the pc
and then use CDO to send a message from another VBA application?

On 26 Nov, 17:13, Robin9876 wrote:
Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.

On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:

Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.


"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?



  #14  
Old November 28th 07, 05:45 PM posted to microsoft.public.outlook.program_vba
Robin9876
external usenet poster
 
Posts: 10
Default VBA to Send message from a named Mailbox

I have used the VBA example code for CDO message from the following
Microsoft KB article http://support.microsoft.com/kb/161833

However the message were queued up in in this profile until I logged
in to it in Outlook.

How is it possible in the code to force a send message for this
profile?

On 27 Nov, 17:34, "Sue Mosher [MVP-Outlook]"
wrote:
Nothing in particular happens. CDO for Windows doesn't use Outlook in any way.

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

"Robin9876" wrote in ...
Do you know what happens if you already have Outlook open on the pc
and then use CDO to send a message from another VBA application?


On 26 Nov, 17:13, Robin9876 wrote:
Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.


On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:


Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.


"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?


  #15  
Old November 28th 07, 06:25 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA to Send message from a named Mailbox

That's CDO 1.21, which is completely different from the CDO for Windows library that I recommended as a way of bypassing Outlook completely. If you want to use CDO 1.21 and contend with its security prompts, you can use its Session.DeliverNow method to send whatever is in the Outbox.

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


"Robin9876" wrote in message ...
I have used the VBA example code for CDO message from the following
Microsoft KB article http://support.microsoft.com/kb/161833

However the message were queued up in in this profile until I logged
in to it in Outlook.

How is it possible in the code to force a send message for this
profile?

On 27 Nov, 17:34, "Sue Mosher [MVP-Outlook]"
wrote:
Nothing in particular happens. CDO for Windows doesn't use Outlook in any way.


"Robin9876" wrote in ...
Do you know what happens if you already have Outlook open on the pc
and then use CDO to send a message from another VBA application?


On 26 Nov, 17:13, Robin9876 wrote:
Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.


On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:


Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.


"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?


  #16  
Old November 29th 07, 04:43 PM posted to microsoft.public.outlook.program_vba
Robin9876
external usenet poster
 
Posts: 10
Default VBA to Send message from a named Mailbox

I did not realise there was a difference.

Are you able to tell within the code that as message has been
successfully sent?

On 28 Nov, 17:25, "Sue Mosher [MVP-Outlook]"
wrote:
That's CDO 1.21, which is completely different from the CDO for Windows library that I recommended as a way of bypassing Outlook completely. If you want to use CDO 1.21 and contend with its security prompts, you can use its Session.DeliverNow method to send whatever is in the Outbox.

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

"Robin9876" wrote in ...
I have used the VBA example code for CDO message from the following
Microsoft KB articlehttp://support.microsoft.com/kb/161833


However the message were queued up in in this profile until I logged
in to it in Outlook.


How is it possible in the code to force a send message for this
profile?


On 27 Nov, 17:34, "Sue Mosher [MVP-Outlook]"
wrote:
Nothing in particular happens. CDO for Windows doesn't use Outlook in any way.
"Robin9876" wrote in ...
Do you know what happens if you already have Outlook open on the pc
and then use CDO to send a message from another VBA application?


On 26 Nov, 17:13, Robin9876 wrote:
Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.


On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:


Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.


"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?


  #17  
Old November 29th 07, 05:39 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default VBA to Send message from a named Mailbox

There is a huge difference. CDO 1.21 depends on Outlook mail profiles and will give you security prompts. CDO for Windows needs only SMTP server information and involves no security prompts; I recommend it for your scenario. It should give you some indicator of message send success or failure, but I've never looked for the details. For CDO 1.21, of course, you would know the item is successfully sent when it arrives in the Sent Items folder.

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


"Robin9876" wrote in message ...
I did not realise there was a difference.

Are you able to tell within the code that as message has been
successfully sent?

On 28 Nov, 17:25, "Sue Mosher [MVP-Outlook]"
wrote:
That's CDO 1.21, which is completely different from the CDO for Windows library that I recommended as a way of bypassing Outlook completely. If you want to use CDO 1.21 and contend with its security prompts, you can use its Session.DeliverNow method to send whatever is in the Outbox.

"Robin9876" wrote in ...
I have used the VBA example code for CDO message from the following
Microsoft KB articlehttp://support.microsoft.com/kb/161833


However the message were queued up in in this profile until I logged
in to it in Outlook.


How is it possible in the code to force a send message for this
profile?


On 27 Nov, 17:34, "Sue Mosher [MVP-Outlook]"
wrote:
Nothing in particular happens. CDO for Windows doesn't use Outlook in any way.
"Robin9876" wrote in ...
Do you know what happens if you already have Outlook open on the pc
and then use CDO to send a message from another VBA application?


On 26 Nov, 17:13, Robin9876 wrote:
Yes it is IMAP, so the SMTP by sending either with the toolbar or CDO
should work.


On 23 Nov, 18:55, "Sue Mosher [MVP-Outlook]"
wrote:


Do you mean IMAP, not LMAP? IMAP is a protocol for receiving messages. SMTP is the protocol used for sending.


"Robin9876" wrote in ...
It is connecting to a mail server via LMAP which I thought CDO only
connects to SMTP server?


On 23 Nov, 15:48, "Sue Mosher [MVP-Outlook]"
wrote:
Not if Outlook is already running. Only one Outlook session can be running at a time.


Is Outlook really necessary to your Access application? Have you thought about using CDO for Windows to send directly through an SMTP server?


 




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
Delegation and Send on Behalf Permissions - Other users Mailbox Gus Whitehouse Outlook - General Queries 0 October 4th 07 03:50 AM
Named properties in PS_INTERNET_HEADERS don't go back to named properties when recieved. Vandal Add-ins for Outlook 4 October 3rd 07 03:54 PM
Can I have a message resend itself from the recipient's mailbox? plh Outlook and VBA 4 February 2nd 07 01:24 PM
How to move send mails to secondary mailbox Gvaram Outlook and VBA 4 October 3rd 06 06:45 AM
Outlook 2000 mailbox cannot view embedded text in message Andy S. Outlook - General Queries 2 July 6th 06 10:53 PM


All times are GMT +1. The time now is 10:06 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.