7 Replies - 19889 Views - Last Post: 04 April 2012 - 08:13 PM Rate Topic: -----

#1 keithmoloney  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 41
  • Joined: 04-April 08

send outlook mail without asking user permission

Posted 22 April 2008 - 06:19 AM

 Dim oApp As Outlook._Application
		oApp = New Outlook.Application()

		Dim strDest As String = "C:\Documents and Settings\kmoloney\Desktop\kmoloney"
		


		' Create a new MailItem.
		Dim oMsg As Outlook._MailItem
		oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)
		oMsg.Subject = "Success" 'title
		'message body
		oMsg.Body = frmTEST1.Label1.Text + Environment.NewLine + _
		"Files have been copied to " + frmTEST1.txtDest.Text + Environment.NewLine + _
		"" + Environment.NewLine + "The files that were copied are: " + Environment.NewLine + _
		frmTEST1.txtList.Text




		'manager and librarian email will be entered here
		oMsg.To = "blah@blah.com"

		'	  Dim sBodyLen As String = oMsg.Body.Length

		' Send
		oMsg.Send()

		' Clean up
		oApp = Nothing
		oMsg = Nothing


	End Sub



when this code runs it will send the desired email but only after the user hits an "allow" button.
i want to run this automatically, there will be no user to ok it. is there a way to turn off the permission box?

Is This A Good Question/Topic? 1

Replies To: send outlook mail without asking user permission

#2 jg007  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 26
  • Joined: 23-March 08

Re: send outlook mail without asking user permission

Posted 22 April 2008 - 11:22 AM

unfortunately this is a new security feature that MS released following several email virus attacks and I have not found any way to disable it.

I have seen various programs to get around this but at $39 they are a bit expensive :)

to get around this you could use SMTPsend although you would have to get the user to enter their SMTP details to use this.

see this page for some code -

http://www.progtalk....px?ArticleID=52
Was This Post Helpful? 0
  • +
  • -

#3 jg007  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 26
  • Joined: 23-March 08

Re: send outlook mail without asking user permission

Posted 22 April 2008 - 11:32 AM

I have also just found another program that might work around this and is a free download although you are need to pay $199 if you actually include it in a program :)

http://www.dimastr.com/redemption/
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 415
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: send outlook mail without asking user permission

Posted 22 April 2008 - 02:32 PM

Use the System.Net.Mail Namespace.
Was This Post Helpful? 0
  • +
  • -

#5 BloodyPeasant  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 19-June 08

Re: send outlook mail without asking user permission

Posted 04 August 2008 - 08:42 AM

I've had good luck using this free add-in to avoid the MSFT security alerts

ASPEmail
Was This Post Helpful? 0
  • +
  • -

#6 balberts  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 04-April 12

Re: send outlook mail without asking user permission

Posted 04 April 2012 - 07:24 PM

View PostBloodyPeasant, on 04 August 2008 - 08:42 AM, said:

I've had good luck using this free add-in to avoid the MSFT security alerts

ASPEmail

Private Shared Function SendEmail(ByVal ToAddress As String, ByVal Subject As String, ByVal message As String) As Boolean
Try

Dim addrCC As New Mail.MailAddress("emailAddress")
Dim attch As New Mail.Attachment("c:\test.html")
Dim MyMailMessage As New Mail.MailMessage
Dim addrTo As New Mail.MailAddress(ToAddress)
With MyMailMessage
.From = New Mail.MailAddress("emailAddress")
.To.Add(addrTo)
.CC.Add(addrCC)
.Attachments.Add(attch)
.Subject = Subject
.Body = message
.Priority = Mail.MailPriority.High
End With

Dim SMTPClient As New Mail.SmtpClient("mail.somewhere.co.nz")
AddHandler SMTPClient.SendCompleted, AddressOf SendCompletedCallback
With SMTPClient
.Host = "serverName"
.DeliveryMethod = Mail.SmtpDeliveryMethod.Network
.Credentials = New NetworkCredential("emailAddress", "Password")
.EnableSsl = True
.Timeout = 10
.Send(MyMailMessage)
End With
SendEmail = True

Catch eX As Exception
SendEmail = False
CallErrors("clsEmail", "SendEmail", eX.Message)
End Try

End Function
Was This Post Helpful? 0
  • +
  • -

#7 DimitriV  Icon User is offline

  • Don't try to save yourself… the circle is complete
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,632
  • Joined: 24-July 11

Re: send outlook mail without asking user permission

Posted 04 April 2012 - 07:31 PM

Why post code like that? Have you an issue?
Was This Post Helpful? 0
  • +
  • -

#8 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 956
  • View blog
  • Posts: 3,676
  • Joined: 02-July 08

Re: send outlook mail without asking user permission

Posted 04 April 2012 - 08:13 PM

Hey @DimitriV, he is just necromancing this thread!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1