Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook - General Queries (http://www.outlookbanter.com/outlook-general-queries/)
-   -   Mapi/CDO Outlook emailing (http://www.outlookbanter.com/outlook-general-queries/73311-mapi-cdo-outlook-emailing.html)

Jon Lewis June 10th 08 10:59 AM

Mapi/CDO Outlook emailing
 
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security dialog
box for each email

How can I avoid this.

TIA



Sue Mosher [MVP-Outlook] June 10th 08 01:48 PM

Mapi/CDO Outlook emailing
 
You need to call Send for each item to send it. See http://www.outlookcode.com/article.aspx?ID=52 for your options with regard to the "object model guard" security prompts.

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


"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message ...
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security dialog
box for each email

How can I avoid this.

TIA



Jon Lewis June 10th 08 03:46 PM

Mapi/CDO Outlook emailing
 
Hi Sue

I 've already read your object model guard page. I'm using your code from
http://www.outlookcode.com/d/code/htmlimg.htm
to embed an image.

I idealy want Outlook to do the sending and would like the set of messages
to be waiting in the outbox but in the italicised state i.e. when ToolsSend
& Receive is selected they are all sent in one operation. (Auto send would
be turned off)

Sound like it's not possible without individual security prompts if
objOutlookMsg.Send is in the messageset code loop.

Manually selecting all the messages once they're in the Outlook Outbox and
chaging their state to Send would be OK but doesn't appear to be possible
either.

If I'm understanding your image embedding routine correctly, you have to use
Outlook to add the HTML body having created the imageID using CDO.

So after the ' get the Outlook MailItem again
Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntry ID)
' add HTML content -- the IMG tag
l_Msg.HTMLBody = "IMG align=baseline border=0 hspace=0 src=cid:myident"
l_Msg.Close (olSave)

...Routine

Can I then use the not yet de-referenced MAPI.Message object to send the
email with CDO?

Many thanks for your help

Jon


"Sue Mosher [MVP-Outlook]" wrote in message
...
You need to call Send for each item to send it. See
http://www.outlookcode.com/article.aspx?ID=52 for your options with regard
to the "object model guard" security prompts.

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


"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one
security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security dialog
box for each email

How can I avoid this.

TIA





Sue Mosher [MVP-Outlook] June 10th 08 05:01 PM

Mapi/CDO Outlook emailing
 
CDO 1.21 is subject to security prompts. I would suggest that you use either Redemption or CDO for Windows, depending on whether you need to maintain a record of the sent messages in the current user's folders.

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


"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message ...
Hi Sue

I 've already read your object model guard page. I'm using your code from
http://www.outlookcode.com/d/code/htmlimg.htm
to embed an image.

I idealy want Outlook to do the sending and would like the set of messages
to be waiting in the outbox but in the italicised state i.e. when ToolsSend
& Receive is selected they are all sent in one operation. (Auto send would
be turned off)

Sound like it's not possible without individual security prompts if
objOutlookMsg.Send is in the messageset code loop.

Manually selecting all the messages once they're in the Outlook Outbox and
chaging their state to Send would be OK but doesn't appear to be possible
either.

If I'm understanding your image embedding routine correctly, you have to use
Outlook to add the HTML body having created the imageID using CDO.

So after the ' get the Outlook MailItem again
Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntry ID)
' add HTML content -- the IMG tag
l_Msg.HTMLBody = "IMG align=baseline border=0 hspace=0 src=cid:myident"
l_Msg.Close (olSave)

..Routine

Can I then use the not yet de-referenced MAPI.Message object to send the
email with CDO?

Many thanks for your help

Jon


"Sue Mosher [MVP-Outlook]" wrote in message
...
You need to call Send for each item to send it. See
http://www.outlookcode.com/article.aspx?ID=52 for your options with regard
to the "object model guard" security prompts.



"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one
security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security dialog
box for each email

How can I avoid this.

TIA





Jon Lewis[_2_] June 10th 08 11:06 PM

Mapi/CDO Outlook emailing
 
Thanks Sue

What about this though?

http://www.mapilab.com/outlook/security

Sounds like it should work



"Sue Mosher [MVP-Outlook]" wrote in message
...
CDO 1.21 is subject to security prompts. I would suggest that you use either
Redemption or CDO for Windows, depending on whether you need to maintain a
record of the sent messages in the current user's folders.

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


"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
Hi Sue

I 've already read your object model guard page. I'm using your code from
http://www.outlookcode.com/d/code/htmlimg.htm
to embed an image.

I idealy want Outlook to do the sending and would like the set of messages
to be waiting in the outbox but in the italicised state i.e. when
ToolsSend
& Receive is selected they are all sent in one operation. (Auto send would
be turned off)

Sound like it's not possible without individual security prompts if
objOutlookMsg.Send is in the messageset code loop.

Manually selecting all the messages once they're in the Outlook Outbox and
chaging their state to Send would be OK but doesn't appear to be possible
either.

If I'm understanding your image embedding routine correctly, you have to
use
Outlook to add the HTML body having created the imageID using CDO.

So after the ' get the Outlook MailItem again
Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntry ID)
' add HTML content -- the IMG tag
l_Msg.HTMLBody = "IMG align=baseline border=0 hspace=0 src=cid:myident"
l_Msg.Close (olSave)

..Routine

Can I then use the not yet de-referenced MAPI.Message object to send the
email with CDO?

Many thanks for your help

Jon


"Sue Mosher [MVP-Outlook]" wrote in message
...
You need to call Send for each item to send it. See
http://www.outlookcode.com/article.aspx?ID=52 for your options with regard
to the "object model guard" security prompts.



"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate
a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and
then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one
security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security dialog
box for each email

How can I avoid this.

TIA







Sue Mosher [MVP-Outlook] June 10th 08 11:23 PM

Mapi/CDO Outlook emailing
 
Avoiding the prompts completely by writing code with Redemption or CDO for Windows is a better solution, IMO.

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


"Jon Lewis" wrote in message ...
Thanks Sue

What about this though?

http://www.mapilab.com/outlook/security

Sounds like it should work



"Sue Mosher [MVP-Outlook]" wrote in message
...
CDO 1.21 is subject to security prompts. I would suggest that you use either
Redemption or CDO for Windows, depending on whether you need to maintain a
record of the sent messages in the current user's folders.



"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
Hi Sue

I 've already read your object model guard page. I'm using your code from
http://www.outlookcode.com/d/code/htmlimg.htm
to embed an image.

I idealy want Outlook to do the sending and would like the set of messages
to be waiting in the outbox but in the italicised state i.e. when
ToolsSend
& Receive is selected they are all sent in one operation. (Auto send would
be turned off)

Sound like it's not possible without individual security prompts if
objOutlookMsg.Send is in the messageset code loop.

Manually selecting all the messages once they're in the Outlook Outbox and
chaging their state to Send would be OK but doesn't appear to be possible
either.

If I'm understanding your image embedding routine correctly, you have to
use
Outlook to add the HTML body having created the imageID using CDO.

So after the ' get the Outlook MailItem again
Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntry ID)
' add HTML content -- the IMG tag
l_Msg.HTMLBody = "IMG align=baseline border=0 hspace=0 src=cid:myident"
l_Msg.Close (olSave)

..Routine

Can I then use the not yet de-referenced MAPI.Message object to send the
email with CDO?

Many thanks for your help

Jon


"Sue Mosher [MVP-Outlook]" wrote in message
...
You need to call Send for each item to send it. See
http://www.outlookcode.com/article.aspx?ID=52 for your options with regard
to the "object model guard" security prompts.



"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate
a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and
then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one
security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security dialog
box for each email

How can I avoid this.

TIA







Jon Lewis June 11th 08 02:04 PM

Mapi/CDO Outlook emailing
 
I'm sure you're right Sue but as I understand it CDO for Windows bypasses
Outlook completely and Redemption costs $200 even for small internal
application use.

Thanks for your help

"Sue Mosher [MVP-Outlook]" wrote in message
...
Avoiding the prompts completely by writing code with Redemption or CDO for
Windows is a better solution, IMO.

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


"Jon Lewis" wrote in message
...
Thanks Sue

What about this though?

http://www.mapilab.com/outlook/security

Sounds like it should work



"Sue Mosher [MVP-Outlook]" wrote in message
...
CDO 1.21 is subject to security prompts. I would suggest that you use
either
Redemption or CDO for Windows, depending on whether you need to maintain a
record of the sent messages in the current user's folders.



"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
Hi Sue

I 've already read your object model guard page. I'm using your code
from
http://www.outlookcode.com/d/code/htmlimg.htm
to embed an image.

I idealy want Outlook to do the sending and would like the set of
messages
to be waiting in the outbox but in the italicised state i.e. when
ToolsSend
& Receive is selected they are all sent in one operation. (Auto send
would
be turned off)

Sound like it's not possible without individual security prompts if
objOutlookMsg.Send is in the messageset code loop.

Manually selecting all the messages once they're in the Outlook Outbox
and
chaging their state to Send would be OK but doesn't appear to be possible
either.

If I'm understanding your image embedding routine correctly, you have to
use
Outlook to add the HTML body having created the imageID using CDO.

So after the ' get the Outlook MailItem again
Set l_Msg = objApp.GetNamespace("MAPI").GetItemFromID(strEntry ID)
' add HTML content -- the IMG tag
l_Msg.HTMLBody = "IMG align=baseline border=0 hspace=0
src=cid:myident"
l_Msg.Close (olSave)

..Routine

Can I then use the not yet de-referenced MAPI.Message object to send the
email with CDO?

Many thanks for your help

Jon


"Sue Mosher [MVP-Outlook]" wrote in message
...
You need to call Send for each item to send it. See
http://www.outlookcode.com/article.aspx?ID=52 for your options with
regard
to the "object model guard" security prompts.



"Jon Lewis @btinternet.com" jon.lewisnospam wrote in message
...
I'm using a mapi/cdo routine (based on code from Sue Mosher) to generate
a
mass email from a CRM Access application.

I'm looping through a recordset adding email body/attachments etc and
then

objOutlookMsg.Close (olSave)
objOutlookMsg.Move objOutlookDestFolder

for each message saves the email to the Outlook Outbox and only one
security
warning is thrown for the entire session which is fine.

However, all the messages in the Outbox are non-italicised, i.e. each
one
has to be opened up and Send clicked.

If I add objOutlookMsg.Send to the loop, I get a separate security
dialog
box for each email

How can I avoid this.

TIA










All times are GMT +1. The time now is 11:23 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-2006 OutlookBanter.com