View Single Post
  #1 (permalink)  
Old July 7th, 2010, 10:32 AM
lkumar_esoftsys lkumar_esoftsys is offline
Registered User
 
Join Date: Jul 2010
Location: Bangalore, Karnataka, India
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Send an email using MAPI sessions through VB 6.0

Hi All,
  1. I am trying to send an email using MAPI controls from my VB Application. But while sending email I will get an pop message from Microsoft outlook which says

    “A Program is trying to access e-mail address information
    stored in Outlook. If this is unexpected, click Deny and
    verify your anti virus software is up-to-date.


    For more information about e-mail safety and how you
    might be able to avoid getting this warning, click Help.”


    With a check box “Allow access for” and a combo box that shows the list of minutes from 1, 2, 5 & 10 minutes.

    With 3 buttons saying Allow, Deny & Cancel.
  2. After clicking on the allow button I will get another pop up message from Microsoft outlook which says

    “A Program is trying to access e-mail address information
    stored in Outlook. If this is unexpected, click Deny and
    verify your anti virus software is up-to-date.

    For more information about e-mail safety and how you

    might be able to avoid getting this warning, click Help.”


    With 3 buttons saying Allow, Deny & Cancel.
For each and every email that I send, I need to click on Allow button twice.

Please help me on how to disable this pop up message.

Below is the piece of code which I used to send email using MAPI Controls.

With frmMain
If .objMAPISess.SessionID = 0 Then
.objMAPISess.LogonUI = True
.objMAPISess.SignOn
End If

.objMAPIMess.SessionID = .objMAPISess.SessionID
.objMAPIMess.Compose
.objMAPIMess.AddressResolveUI = True

.objMAPIMess.AttachmentPathName = App.Path & "\Mail\" & p_strFileName & ".pdf"

If (Trim(p_strEmailID) <> "") Then
.objMAPIMess.AddressResolveUI = False
.objMAPIMess.RecipIndex = 0
.objMAPIMess.RecipType = 1
.objMAPIMess.RecipAddress = p_strEmailID
.objMAPIMess.ResolveName

.objMAPIMess.RecipIndex = 1
.objMAPIMess.RecipType = 3
.objMAPIMess.RecipAddress = strFacilityEMail
.objMAPIMess.ResolveName

.objMAPIMess.MsgSubject = p_strSubject
.objMAPIMess.MsgNoteText = p_strMessage
.objMAPIMess.send showDialog:=False 'True
End If
End With

Thanks & Regards
Lakshmi Kumar
Reply With Quote