Groups | Blog | Home
all groups > sql server programming > january 2004 >

sql server programming : outlook


akashdeep jain
1/18/2004 11:39:17 PM
i am using mapi in my application to send mail to
different locations of our company .

It is working absolutely fine but the problem is
everytime it tries to send a mail outlook presents a
dialog do you want to send mail (yes or no)

i want to avoid this dialog

Rohtash Kapoor
1/19/2004 12:22:14 AM
In your Outlook, Tools-->Options--->Sent--->Send messages immediately.

Set this option, and see if this works.

---
Rohtash Kapoor
http://www.sqlmantra.com

[quoted text, click to view]

AkashDeep Jain
1/19/2004 1:27:21 AM
the option is already set but it is still not working

this the the code

Private Sub eMailByMapi(mailID As String, Optional mailCC As String =
"", Optional mailAttach As String = "", Optional mailSubject As String =
"Auto mail By Next", Optional mailSender As String = "", Optional
mailActFile As String = "emailAttachement.ked")
lblDTS(0) = "Sending..."
Dim varFileCont As Variant
On Error GoTo ErrHnd
Dim lngErr As Long
'MS.SignOff
MS.UserName = "dtsmum"
MS.Password = "1"
MS.SignOn
MM.SessionID = MS.SessionID

MM.MsgIndex = -1

MM.Compose
MM.MsgSubject = mailSubject
MM.MsgNoteText = "Automatically Mailed By ErpDts"

MM.RecipIndex = 0
MM.RecipType = 1
MM.RecipDisplayName = mailID

MM.RecipIndex = 1
MM.RecipType = 3
MM.RecipDisplayName = "dtsmum@kasyap.com"

If mailCC <> "" And mailID <> mailCC Then
MM.RecipIndex = 2
MM.RecipType = 2
MM.RecipDisplayName = mailCC
End If

mailAttach = mailAttach
MM.AttachmentPathName = mailAttach
MM.Send False
MS.SignOff
lblDTS(0) = "IDLE"
Exit Sub
' ************
ErrHnd:
' Handle all errors except for async winsock errors
lngErr = Err.Number - vbObjectError
If ((lngErr < 0) Or (lngErr > 65535)) Then lngErr = Err.Number
MsgBox Err.Description & " - Error # " & lngErr, vbCritical, "Error
Message"
Resume
End Sub


suggest me some other alternative

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button