Solved

Supressing prompts when sending e-mail with Outlook

Posted on 2013-12-09
4
385 Views
Last Modified: 2013-12-19
I am sending an e-mail with MS Outlook via PowerShell and the script below works great, except it displays a number of prompts which i want to suprss, since in the future the script will run from Windows scheduler. Can anyone help?

$ol = New-Object -comObject Outlook.Application 
$message = $ol.CreateItem(0)
$message.Recipients.Add("test@me.com")  
$message.Subject = "Report"  
$message.Body = "Attachment contains one report"

# Attach a file 
$file = "C:\TestReport.csv"

$message.Attachments.Add($file)
$message.Send()

Open in new window

0
Comment
Question by:YZlat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
Angelp1ay earned 500 total points
ID: 39707222
Are they messages like this?
A program is trying to perform an action that may result in an e-mail message being sent on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date.

If so this Microsoft help article seems exactly what you want! I've tried to extract the relevant bit for you below :)

http://office.microsoft.com/en-ca/outlook-help/i-get-warnings-about-a-program-accessing-e-mail-address-information-or-sending-e-mail-on-my-behalf-HA001229943.aspx
Prevent this security warning from appearing again
Under certain conditions, installing an antivirus program and keeping it updated regularly might prevent this security warning from appearing again. The conditions are as follows:

- Your antivirus software must be compatible with Microsoft Windows XP Service Pack 2 (SP2). Check with your antivirus software vendor.
- Your antivirus software must be updated regularly. Most antivirus programs enable you to get automatic updates when you are online. Check with your antivirus software vendor.
- Your antivirus software is configured to share its update status with other applications. Typically, antivirus programs share their update status with other applications by default.

To check the update status setting, look in the preferences or options for your antivirus program, or check with your antivirus software vendor.

View security settings in the Trust Center
The Programmatic Access security settings in the Trust Center provide the following options:

- Warn me about suspicious activity when my antivirus software is inactive or out-of-date (recommended)     This is the default setting in Office Outlook 2007. Suspicious activity refers to an untrusted program attempting to access Outlook.
- Always warn me about suspicious activity     This is the most secure setting and you will always be prompted to make a trust decision when a program attempts to access Outlook.
- Never warn me about suspicious activity (not recommended)     This is the least secure setting.

To view these settings, do the following:
- On the Tools menu, click Trust Center.
- Click Programmatic Access.
0
 
LVL 40

Expert Comment

by:footech
ID: 39707427
I would ask why you are sending via Outlook instead of just using the Send-MailMessage cmdlet.
0
 
LVL 35

Author Comment

by:YZlat
ID: 39727521
I can only use SMTP server name on production servers but to send e-mail from development machine I cannot use Send-MailMessage. Outlook allows me not to spcify SMTP server
0
 
LVL 35

Author Closing Comment

by:YZlat
ID: 39730352
Thanks
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question