A program is trying to send e-mail on your behalf , how to bypass this message

C

Carlos

I have an app in VB.net that use outlook object to send an email using an
exchange server, but when I send the email I get "A program is trying to
send e-mail on your behalf" so can I bypass that message

Thanks
 
Joined
Dec 16, 2009
Messages
1
Reaction score
0
bypass "A program is trying to send e-mail on your behalf"

You can install additional software to bypass the security of your system.
But there is another way that is much easier.
Actually, you can do it without any extra software and without risking your safety.


STEP 1)

Instead of sending the email directly, you can simply save it.
No po-pup appears.
In an Excel VBA code it could look like this:

Public Sub SaveEmail()
Dim lApp
Dim lMailItem
Dim lMail

Set lApp = CreateObject("Outlook.Application")
Set lMail = lApp.CreateItem(lMailItem)
With lMail
.Subject = "#xxxxxxxx"
.Body = "sdafösadjgölasdkgjasdl"
.To = "(e-mail address removed)"
.Save
End With
End Sub


STEP 2)

Change your security settings in Outlook by enabling Macro executions.

Menu Tools-> Macro -> Security -> any option that allows executing Macros


STEP 3)

Open your VBA code editor in Outlook and add the following lines in "ThisOutlookSession":


Private WithEvents Items As Outlook.Items


Private Sub Application_Startup()
' set up event calls
Dim lNameSpace As Outlook.NameSpace
Set lNameSpace = GetNamespace("MAPI")
Set Items = lNameSpace.GetDefaultFolder(olFolderDrafts).Items
End Sub


Private Sub Items_ItemAdd(ByVal Item As Object)
Dim lNameSpace As Outlook.NameSpace
Set lNameSpace = GetNamespace("MAPI")
Dim lMailItem As Outlook.MailItem

If TypeOf Item Is Outlook.MailItem Then
Set lMailItem = Item
If (InStr(1, lMailItem.Subject, "#") = 1) Then
lMailItem.Subject = Right(lMailItem.Subject, Len(lMailItem.Subject) - 1)
Call lMailItem.Send
End If
End If
End Sub


STEP 4)

Check it out.



PS:

The "#" in

a) .Subject = "#xxxxxxxx"
b) If (InStr(1, lMailItem.Subject, "#") = 1) Then

can be seen as a security string. You can eg. replace it by "mypwd" or any other string.
It makes sure, you do not send all drafts out immediately.
You also make sure, no malicious program can send emails or bypass your system.
Therefore you are still safe despite circumventing Microsoft's new security feature.


:)
Bastian M.K. Ohta
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top