Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2009, 11:23 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default Sending Mail with CDO

Code:
In Proj.vbp, have the following reference:
 
Reference=*\G{3FA7DEA7-6438-101B-ACC1-00AA00423326}#1.15#0#_
..\..\..\Program Files\Common Files\System\MSMAPI\1033_
\CDO.DLL#Microsoft CDO 1.21 Library
 
In code, I have:
Public Sub MySendMail(argTo As String, _
                argMsg As String, _
                argSubj As String)
 
On Error GoTo Er
 
Dim mSn    As New MAPI.Session
      Dim ...
 
mSn.Logon "brian.wren"          ' This initiates a 
                              ' long wait, followed
...                             ' by two Dlg.s.
This is problematic for me. I am testing the proof of concept with this, and, if it flies, this will be incorporated into an .EXE that runs unattended on a server, having been started by TaskManager, and therefore having no desktop (at least not a visible one.)

That means thet no one will be able to service the dialogs, should they pop up.

What do I need to do to make it so that logging on using CDO doesn't raise a warning?

I know that “trust” and “trust relationships” are becoming quite an issue, but I don’t know if this involves that technical term. So I would like to know what it does involve.

But even if this is a “trust relationship” issue, I don't know how to establish sufficient trust to qwell the message that pops up.

The message is ...

Well. Just now I retried it to get the text of the elements. .Logon does create a long wait, but, it was the line:

Recipients (AS MAPI.Recipeints) .Resolve

that raised a complaint:
Code:
__________________________________________________________
[ Microsoft Office Outlook                             [x] ]
 
/!\ A program is trying to access email addresses you have
    stored in Outlook.  Do you want to allow this?
 
    If this is unexpected, it may be a virus & you should
    choose "No."
     _                     ________________
    [_] Allow access for  [ 1 minute   [\/]] <——<< Drp-dn
      _________     ________     __________
     [   Yes   ]   [   No   ]   [   Help   ]
      ¯¯¯¯¯¯¯¯¯     ¯¯¯¯¯¯¯¯     ¯¯¯¯¯¯¯¯¯¯
msg.Send raises a similar error.
 
Old April 13th, 2009, 01:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

As far as I know, this doesn't have anything to do with VB, it relates Outlook security. Anyway, Maybe you can just trace the outlook windows and press the buttons (all done within the program).

Did the pop up raises if you use a control within a form??? (just curiosity)...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old April 16th, 2009, 02:51 AM
Authorized User
 
Join Date: Mar 2009
Posts: 49
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Just like having a form appear from an icon in the task bar...could you not use a form even if it is a simple about form to contain the control and use a timer to make sure the form closes in a few seconds so as not to interfere too much with your process. Just a thought...

Then the other though is the MAPI API of which you will find defined in the same folder as the win32 api file but I am not sure as I can't remember where I put my example code but I know there is some out there (and maybe even on this site in some archive as I remember a book about MAPI).

Good Luck





Similar Threads
Thread Thread Starter Forum Replies Last Post
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
Sending Email from ADP using CDO Scripts82 Access VBA 2 March 29th, 2006 10:50 AM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.