Solved

Supressing prompts when sending e-mail with Outlook

Posted on 2013-12-09
4
361 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 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

820 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