Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Message in Outlook

Status
Not open for further replies.

Mollethewizard

IS-IT--Management
Nov 18, 2002
93
0
0
SE
I’ve made a program in Excel that sends e-mail in Outlook (2010) after the user has put same information in a user form. This Is not a problem but I get this annoying message – “another program Is trying to send an e-mail etc.” Allow – Deny – Help. I’ve searched for help but I haven’t found anything that could solve the “problem”. Have anyone suggestions for a solution? Is it possible programmatically to get rid of the message?
Geetings Christer
 
Here's why it happens:

Microsoft said:
These security warnings appear when a program attempts to access your contact information in the Outlook Address Book, or attempts to send e-mail on your behalf. By default, only COM add-ins are trusted programs. Your e-mail administrator may have allowed only specific add-ins by adding them to a "Trusted add-ins" list. Any other program is not trusted, and a security warning appears because of the potential risk that the program is malicious and designed to use Outlook to spread viruses. Before this safeguard was put in place, viruses such as Melissa and ILOVEYOU were able to access Outlook and spread by sending messages to the people listed in Contacts.

Here's a Microsoft article on the subject, with suggested 'fixes'. The one most appropriate for you would be the one at the end under "View security settings in the Trust Center", but be aware that if you play around with the settings here you potentially open up Outlook to abuse. Also note (not mentioned in the article) that if you are running under Vista or Windows 7, then all the security options, even on a standalone machine, will be greyed out unless you run Outlook as Administrator.

There are other options, such as Outlook Redemption or even ClickYes (although I don't think they do a free version for Outlook 2010)
 
Then my users will have to take the disadvantage to press Allow to send the message.
Thanks for the answer.
Christer
 
You may send an e-mail from Excel without the 'Allow – Deny – Help' questions.
From the Exchange Server using reference to MicroSoft CDO for Windows 2000 Library

I have code to do this. Let me know if you want it.

Have fun.

---- Andy
 
Andy –I would appreciate any code to solve this ”problem”!

Christer
 
This is what I use.
I have it set up as a (Public) Sub where I pass strFrom, strTo, strCC, strBCC, strSubject, etc. Well, you get the point. You just have to get your SMTPServer part (in RED)

Code:
[green]      
'Add (Tools -> ) Reference to Microsoft CDO for Windows 2000 Library
[/green]
Dim objMessage As CDO.Message

Set objMessage = New CDO.Message

With objMessage
    .From = [blue]"B_Gates@man.com"[/blue]
    .To = [blue]"Somebody@domain.com"[/blue]
[green]
'    If Len(Trim$(strCC)) > 0 Then
'        .CC = strCC
'    End If
'    If Len(strBcc) > 0 Then
'        .BCC = strBcc
'    End If
    ''' On behalf of
    '.Sender = "abc@xyz.com"[/green]
    .Subject = "This is my Subject"
    .TextBody = "The body of the message"
    [green]
'    If Len(strAttachDoc) > 0 Then
'        .AddAttachment strAttachDoc
'    End If[/green]
    
    With .Configuration.Fields
        .Item(CDO.cdoSMTPServer) = [red]"YOUR.SMTP.SERVER.LAN"[/red]
        .Item(CDO.cdoSMTPServerPort) = 25
        .Item(CDO.cdoSendUsingMethod) = CDO.cdoSendUsingPort
        .Item(cdoSMTPConnectionTimeout) = 10
        .Update
    End With
    .Send
End With

Set objMessage = Nothing

Also, I needed to ask 'people in charge' of the SMTPServer to allow my application to send e-mails this way, because you can send a lot of e-mails and that's dengerous because you can send a lot of SPAM... :)


Have fun.

---- Andy
 
>without the 'Allow – Deny – Help' questions

Just to clarify for the original poster, this is because the proposed solution is not using Outlook at all.

And, as Andrzejek hints, in a corporate environment this solution might well be blocked.

If it isn't then CDO for Windows 2000 is a great (and under-appreciated) alternative to trying to leverage Outlook.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top