Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Sending Problem in VB

Status
Not open for further replies.

oops4me

Programmer
Jul 7, 2003
50
IN
Hi There,

i am trying to send the mail using Outlook(MAPI) from VB. but when i send it confirms with me with a prompt Like



"A program is trying to automatically send e-mail on your behalf. do you want to allow this?

if this is unexpected, it may be a virus abd you should choose NO.

Yes NO Cancel
"



How can i solve this problem

I have written the following code.


Dim oObj As New Outlook.Application
Public WithEvents oNS As Outlook.Namespace
Public WithEvents oMI As Outlook.MailItem

Private Sub Form_Load()
Set oNS = oObj.GetNamespace("MAPI")
Set oMI = oNS.Application.CreateItem(olMailItem)

With oMI
.To = "xyz@abc.com"
.Subject = "Test Message"
.Body = "Test Message"
.Send
End With
End Sub

Thankx in advance
Mohit Prabhu
 
Hi there

i visited to the respective sites but didn't find any good answers


Please help me on this

thankx
 
The 'problem' is that Microsoft tightened the security on Outlook a number of years ago in (a knee-jerk, IMHO) response to the increasing number of email borne virii

They don't provide a way of switching it off ...

We've covered this a number of times in here before, and there are solutions. A number of us use and recommend
 
A very cursory search on this forum gives loads of answers. Read faq222-2244 to see how to do your basic research.

One of the threads shown is thread222-914089 which offers 2 different solutions. I'll leave the rest for you to find!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top