[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5769
  • Last Modified:

I need to disable the Outlook warning "A program is trying to automatically send email on your behalf"

I have vb written that sends an email from Access, and that is all well, but when it goes through Outlook I get the warning "A program is trying to automatically send email on your behalf". I have looked at many, many, many, many sites that have tips and tricks to get around this, and it all seems WAY too complicated. Isn't there an easier way, through code or something? A detailed description of how to accomplish this will be very much appreciated. Thanks.
0
horstuff
Asked:
horstuff
  • 8
  • 5
  • 4
  • +2
1 Solution
 
Steve BinkCommented:
Nope, no easier way.  That warning is now built in to Outlook to do exactly what it is doing.  The CDONTS work-around is the easiest I've seen.
0
 
Steve BinkCommented:
0
 
Steve BinkCommented:
Here's more information on what affects the update has:

http://support.microsoft.com/kb/262634/EN-US/
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
stevbeCommented:
there are "simple mapi" modules out there that send email without using outlook at all and are easy to use.

http://www.trigeminal.com/lang/1033/codes.asp?ItemID=24#24

Steve
0
 
horstuffAuthor Commented:
Steve, do you know if the mapi modules will work with an html email? The bottom line on all this is that I need to send .html invoices to customers, and I figured the best way would be to create an html email from the same report that makes them a paper invoice. I have that setup in my code, it look something like this:

Private Sub cmdBBmail_Click()

'1+++++
'You have to output your Report and save it on a disk drive.
'You can do it with HTML to maintain the Report Format.

    DoCmd.OutputTo acOutputReport, "Invoice - with SKU and Options_HTML_Email", acFormatHTML, "c:\Invoice - with SKU and Options_HTML_Email.HTML", False

'2+++++
'Now we will open this file and read the contenet of it in a String Variable called FullText

Dim MyString
Dim FullText As String
Open "c:\Invoice - with SKU and Options_HTML_Email.HTML" For Input As #1    ' Open file for input.
Do While Not EOF(1)    ' Loop until end of file.
    Line Input #1, MyString    ' Read each Line into MyString variable.
    FullText = FullText & MyString     'Put all the Lines read into one String, FullText
Loop
Close #1    ' Close file.

'3+++++
'In Outlook, go to Tools>Option>Mail Format>HTML (use this message format)
'Why HTML, because the base of it is Text, but the output is formated HTML
'We need to have a String to put in the .HTMLBody, not a file

Dim ol As New Outlook.Application
Dim olMail As Outlook.MailItem

    Set olMail = ol.CreateItem(olMailItem)

    With olMail
        .To = "test@mysite.com"
        '.CC = strCC
        '.BCC = "address2@aa.com"
        '.Attachments.Add "c:\somefile.txt"
        '.Attachments.Add "c:\somefile2.txt"
        .Subject = "Testing"
        .HTMLBody = "<img src='http://mysite.com/OM_data/email_logo.gif'>" & FullText 'c:\CVPrint1.HTML"
        '.Body = "This is the body..."
        '.Display
        .Send
    End With

    Set olMail = Nothing
    Set ol = Nothing
End Sub
0
 
stevbeCommented:
I have not tried it but I image that the HTML formatting has more to do with how the recipient has thier email client set up that what you have yours set up as. It is very easy to try out, just own load the zip file, unzip and add the classes direcftly into your database.

Steve
0
 
horstuffAuthor Commented:
how do I add the classes to the .mdb? References? If so, which ones (not all 7???)
0
 
stevbeCommented:
just the .cls and .bas files

from any code window use the Insert --> File Menu.
comment out anything that now displays red.

Steve
0
 
horstuffAuthor Commented:
Steve,

I may be stupid, but how the hell do you add these things? I am trying to add them and it creates a new mod called modMain, then the file.cls gets inserted into it, but it has an invalid procedure where it says OPEN, then I try to install it as a new module, then it crashes, etc etc etc. Could you maybe be a bit more detailed in your instruction? Thanks.
0
 
horstuffAuthor Commented:
as I add the .cls files, it errors an Invalid outside procedure on the word Begin at

BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior = 0   'vbNone
  MTSTransactionMode = 0   'NotAnMTSObject
End
0
 
OrbZeroCommented:
horstuff,

Steve's method is undoubtedly the better one if you can get it to work, but I've been using a program called "Express ClickYes" to get through those e-mail notifications.  It's available at http://www.contextmagic.com/express-clickyes/, and seems to work just fine.  That page gives instructions on how to activate and suspend the service (so other programs can't send e-mail when you're not expecting it), though I tend to shut the program off entirely when I'm not using it... just to be safe.
0
 
stevbeCommented:
comment anything that is now displayed in red.
0
 
horstuffAuthor Commented:
Steve,

It ain't happening. I AM commenting out anything in red. Thanks anyway
0
 
horstuffAuthor Commented:
Well, I figured it out another way. How do I close this question?
0
 
Steve BinkCommented:
Just a reminder, from my first comment:

>>> Nope, no easier way.  That warning is now built in to Outlook to do exactly what it is doing.  The CDONTS work-around is the easiest I've seen.

You can post a request to close this question and refund your points at:

http://www.experts-exchange.com/Community_Support

Also, if you have generated a solution yourself, please post it for the benefits of those who will see this question later.
0
 
horstuffAuthor Commented:
The solution involved Redemption.dll


Dim Application As Outlook.Application
Dim NameSpace As Outlook.NameSpace
Dim Sync

Set Application = CreateObject("Outlook.Application")
Set NameSpace = Application.GetNamespace("MAPI")
NameSpace.Logon
Set Sync = NameSpace.SyncObjects.Item(1)
Sync.start

Dim SafeItem, oItem, Btn
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set oItem = Application.CreateItem(0)
SafeItem.Item = oItem
SafeItem.Recipients.Add "me@mysite.com"
SafeItem.Recipients.ResolveAll
SafeItem.Subject = "Testing Redemption"
SafeItem.HTMLBody = "<img src='http://mysite.com/email_logo.gif'>"
SafeItem.Send
Set Btn = Application.ActiveExplorer.CommandBars.FindControl(1, 5488)
'Set Btn = Application.CommandBars.FindControl(1, 5488)
Btn.Execute
   
End Sub
0
 
Steve BinkCommented:
What is redemption.dll?  What does this line do:

Set Btn = Application.ActiveExplorer.CommandBars.FindControl(1, 5488)
0
 
horstuffAuthor Commented:
routinet,

http://www.dimastr.com/redemption/

that line is a workaround to execute send/recieve in outlook. It is kind of clunky, but it works. I couldn't figure out any other way to get the thing to send (otherwise it just sits in the drafts folder).
0
 
NetminderCommented:
Closed, 250 points refunded.
Netminder
Site Admin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 8
  • 5
  • 4
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now