Solved

Supressing prompts when sending e-mail with Outlook

Posted on 2013-12-09
4
324 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
  • 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 39

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
This article will help you understand what HashTables are and how to use them in PowerShell.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now