Mail Through Outlook Without Security Prompt

N

Neil

When one creates mail in Outlook from another application using Automation,
one gets the Microsoft security prompt that they added. However, when one
creates mail by sending a link from Internet Explorer, one does not get the
security prompt; yet the signature used in Outlook appears in the message.

So the Internet Explorer Send Link by E-mail function accesses Outlook to
get the signature; yet there is no security prompt. How does it do that?

Thanks,

Neil
 
N

Neil

Actually, you're right, it doesn't happen when you use Send Link. It happens
when a web page (such as http://www.myers-services.com/aboutus/team.php)
contains e-mail links. That page contains MailTo: links about halfway down
the page. When you click on one of them, an e-mail message is generated with
the Outlook signature included. This happens whether you use Internet
Explorer or Firefox.

Seems unlikely that Microsoft would help the Firefox people out by giving
them an "in" past the Outlook security prompt. But yet when you click a
MailTo: link from within Firefox, you get an Outlook message with signature
included, without the security prompt. Wonder how they do that?

Thanks,

Neil
 
D

Dmitry Streblechenko

Both IE and FireFox use the "mailto" protocol, which populates the message
recipients, subject and body, then displays the message. Outlook internally
handles all that.
You can do the same using OOM without prompts. Please show your code.
Keep in mind that accessing MailItem.Recipients collection will cause a
prompt, but you can set the MailItem.To/CC/BCC properties without a prompt
since only reading these properties is blocked.

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

Neil

In simplified format, my code is as follows:

Dim objOutlook As Object
Dim objOutlookMsg As Object
Dim objOutlookRecip As Object

Set objOutlook = GetOutlookObject() 'Routine that uses GetObject if
instance exists or CreateObject otherwise

Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(varTo)
objOutlookRecip.Type = olTO

For Each objOutlookRecip In .Recipients
If Not objOutlookRecip.Resolve Then
MsgBox "Could not add " & objOutlookRecip.Name & " to
the e-mail.", vbExclamation
End If
Next
.Display
End With

Thanks,

Neil
 
D

Dmitry Streblechenko

Replace the lines

Set objOutlookRecip = .Recipients.Add(varTo)
objOutlookRecip.Type = olTO

with

..To = varTo

You wown't be able to loop through teh recipients and resolvee them
explicitly, but since you end up displaying the message, Outlook will not
that anyway. Or give an error the user clicks Send.

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

Neil

I'll try that. Thanks!

Dmitry Streblechenko said:
Replace the lines

Set objOutlookRecip = .Recipients.Add(varTo)
objOutlookRecip.Type = olTO

with

.To = varTo

You wown't be able to loop through teh recipients and resolvee them
explicitly, but since you end up displaying the message, Outlook will not
that anyway. Or give an error the user clicks Send.

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

Neil

Just a follow-up note: the code you gave worked great. It's surprising
because everything I've ever read or heard was that you can't get around the
Outlook security prompt. But this works great, and is all that's needed in
situations such as mine, where the To line is being populated from addresses
in a database, rather than from the Outlook address book. Thanks again!

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top