perltrick has asked for the wisdom of the Perl Monks concerning the following question:

I'm experimenting with automatically generated emails via Outlook. With the use of several posted scripts (thank you), I've been able to successfully send test emails using:
my $Outlook = new Win32::OLE('Outlook.Application'); my $item = $Outlook->CreateItem(0); # 0 = mail item. .... fill in properties ... ... $item->send();
So the question, Outlook pops up a warning message indicating that a program is attempting to send an email. Yes is 'grayed' out for 5 seconds, then becomes available, when clicked, the email is successfully sent and received by all addressees. How does one set security parameters to avoid the need for user input to send the message?

Replies are listed 'Best First'.
Re: OLE::Win32 Mail Item->send Warning
by NetWallah (Canon) on Mar 01, 2010 at 17:37 UTC
    The message "A program is trying to send mail ... Do you want to allow...?" has been a "Security Feature" since Outlook 2000 SP2.

    AFAIK, it cannot be disabled.

    Here is a link that claims to have a workaround (VBA):
    http://www.everythingaccess.com/tutorials.asp?ID=Outlook-Send-E-mail-Without-Security-Warning.

         Theory is when you know something, but it doesn't work.
        Practice is when something works, but you don't know why it works.
        Programmers combine Theory and Practice: Nothing works and they don't know why.         -Anonymous

Re: OLE::Win32 Mail Item->send Warning
by jrsimmon (Hermit) on Mar 01, 2010 at 19:58 UTC
    Alternatively, you can avoid Outlook altogether with Mail::Sender. It's a nice, light, stable package that I've found very useful over the years.
Re: OLE::Win32 Mail Item->send Warning
by jand (Friar) on Mar 02, 2010 at 08:37 UTC