I send email through Outlook using VB.Net 2005; this is working fine.
At the same time, however, I receive the following message:
A program is trying to automatically send Email on your behalf.
Do you want to allow this ?
if this is enexpected, it may be virus and you should choose no.
Is there any way to avoid this?
Navigate to File | Options | Trust Center | Trust Center Settings | Programmatic Access. Select “Never warn me about suspicious activity (not recommended) Click "OK"
Change the Programmatic Access Security setting in Outlook In Outlook, select File, and then select Options. Select Trust Center, and then select Trust Center Settings. Select Programmatic Access. If we want to stop these warning permanently, select the Never warn me about suspicious activity (not recommended) option.
A program is trying to access e-mail address information stored in Outlook. If this is unexpected, click Deny and verify your antivirus software is up-to-date. A program is trying to send an e-mail message on your behalf. If this is unexpected, click Deny and verify your antivirus software is up-to-date.
Select File > Options > Trust Center and click Trust Center Settings. 2. Select Programmatic Access. If possible, disable the warning.
This is "by design". It's done to prevent viruses from doing things like going through the address book and automatically sending emails on the user's behalf. Having the dialog prevents a virus from silently becoming a spam bot.
I know this isn't answering your direct question, but is there a reason you can use the System.Net.Mail.MailMessage class and send using that? Or is this because you want the e-mail to show up in their sent items?
You need some library like Redemption to circumvent this popup. It's the default built-in security behaviour of Outlook (since version 2002 I think).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With