How to send a e-mail without asking permission

M

Marco

hello. I'm trying to send an e-mail with an attach directly to a e-mail
addrress without asking permission.

So, I'm using this code, which I found here in these forum:

Dim msg As Outlook.MailItem


strRecipients = Me![txtRecipients].Value
strSubject = Me![txtMessageSubject].Value
strBody = Me![txtMessageBody].Value

(This next line is the one that generates the error)
Set msg = appOutlook.CreateItem(olMailItem)
With msg
.To = "(e-mail address removed)" (this is my e-mail address here)
.BCC = strRecipients
.Subject = strSubject
.Body = strBody
.Display
.Send
End With


What is missing there in order that the window needing me to press Allow
disapear??

Regards,
Marco
 
M

Maverick

Try getting rid of .Display.

-----------------------------------------------------
HTH

Don't forget to rate the post if it was helpful!

My email address is invalid.
Please reply to newsgroup only so that others may benefit.
 
R

Rick Brandt

Marco said:
hello. I'm trying to send an e-mail with an attach directly to a
e-mail addrress without asking permission.

So, I'm using this code, which I found here in these forum:

Dim msg As Outlook.MailItem

strRecipients = Me![txtRecipients].Value
strSubject = Me![txtMessageSubject].Value
strBody = Me![txtMessageBody].Value

(This next line is the one that generates the error)
Set msg = appOutlook.CreateItem(olMailItem)
With msg
.To = "(e-mail address removed)" (this is my e-mail address here)
.BCC = strRecipients
.Subject = strSubject
.Body = strBody
.Display
.Send
End With


What is missing there in order that the window needing me to press
Allow disapear??

Your code cannot turn off the Outlook security message. You can obtain the
Redemption library which provides an interface identical to Outlook , but
which actually uses Extended MAPI to get around the security messages. You
can also use other messaging libraries like CDOSys which is included on all
Windows machines (2000 and higher).
 
M

Marco

..Display just show the windows, such like a quick preview.

I found an option on trust center.

Maverick said:
Try getting rid of .Display.

-----------------------------------------------------
HTH

Don't forget to rate the post if it was helpful!

My email address is invalid.
Please reply to newsgroup only so that others may benefit.


Marco said:
hello. I'm trying to send an e-mail with an attach directly to a e-mail
addrress without asking permission.

So, I'm using this code, which I found here in these forum:

Dim msg As Outlook.MailItem


strRecipients = Me![txtRecipients].Value
strSubject = Me![txtMessageSubject].Value
strBody = Me![txtMessageBody].Value

(This next line is the one that generates the error)
Set msg = appOutlook.CreateItem(olMailItem)
With msg
.To = "(e-mail address removed)" (this is my e-mail address here)
.BCC = strRecipients
.Subject = strSubject
.Body = strBody
.Display
.Send
End With


What is missing there in order that the window needing me to press Allow
disapear??

Regards,
Marco
 
P

Paul Shapiro

Outlook 2007 suppresses the warning message if Windows recognizes that you
have up-to-date antimalware protection.

For earlier Outlook versions, look at www.slipstick.com. You can also use
the free Outlook Click-Yes Express from Context Magic which can
automatically click the message.
 

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