LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default send mail with MAPI problem

Hi all,

Question1:
I do have a problem with the code i found somewhere to send mail using
MAPI.
Everything works fine BUT the mails aren't send, they hang in the
'Send Messages' folder.
Note: I create for every member of our club a separate mail (actually
32 members = 32 separate mails). This works fine, but they aren't
send!
I have Outlook Express on my PC, running Windows98 SE

Question2:
Is it possible, using MAPI control (VBA), to delete the send mails
from my 'Send Mails' folder after the mails are send? If so, how to do
so?

here's the code i use for creating the mails:

Sub Send()
Dim ListEnd As Boolean
On Error GoTo errorhandler
ListEnd = False
frmBulkMail.MAPIMessages1.MsgIndex = -1
frmBulkMail.MAPISession1.SignOn
Select Case MailToType
Case 1 '
Sheets("members").Activate
Range("J2").Select
Case 2 '
Sheets("board").Activate
Range("D2").Select
Case 3 '
Sheets("members").Activate
Range("J2").Select
End Select
Do
Select Case MailToType
Case 1 '
If Trim(ActiveCell.Value) < "" Then
strMailTo = Trim(ActiveCell.Value)
End If
selection.Offset(1, 0).Select 'select next row
Case 2 '
If Trim(ActiveCell.Value) < "" Then
strMailTo = Trim(ActiveCell.Value)
End If
selection.Offset(1, 0).Select 'select next row
Case 3 '
If selection.Offset(0, 1).Value < False Then
strMailTo = Trim(ActiveCell.Value)
End If
selection.Offset(1, 0).Select 'select next row

End Select
If strMailTo < "" Then
frmBulkMail.MAPIMessages1.SessionID =
frmBulkMail.MAPISession1.SessionID
If blContactMe = True Then
frmBulkMail.MAPIMessages1.RecipAddress =
"
Else
frmBulkMail.MAPIMessages1.RecipAddress = strMailTo
End If
If Trim(frmBulkMail.txtSubject) = "" Then
frmBulkMail.MAPIMessages1.MsgSubject = "Dit is een
automatische mail verstuurd door BeLUG Admin."
Else
frmBulkMail.MAPIMessages1.MsgSubject = "BeLUG : " &
frmBulkMail.txtSubject
End If
frmBulkMail.MAPIMessages1.MsgNoteText = frmBulkMail.tbMessage
frmBulkMail.MAPIMessages1.Send
' DoEvents


End If
Select Case MailToType
Case 1
If Trim(selection.Offset(0, -9)) = "" Then
ListEnd = True
End If
Case 2
If ActiveCell.Address = "$D$7" Then
ListEnd = True
End If
Case 3
If selection.Offset(0, 1).Value = False Then
ListEnd = True
End If
End Select
strMailTo = ""
Loop Until ListEnd = True
frmBulkMail.MAPISession1.DownLoadMail = True
frmBulkMail.MAPISession1.SignOff
Exit Sub
errorhandler:
Select Case Err.Number
Case 32010
MsgBox "TooManyRecipients", vbCritical + vbOKOnly
frmBulkMail.MAPISession1.SignOff
Case 32025
MsgBox "InvalidRecips", vbCritical + vbOKOnly
frmBulkMail.MAPISession1.SignOff
Case Else
MsgBox "Fatal Mail Error ", vbCritical + vbOKOnly
frmBulkMail.MAPISession1.SignOff
End Select
End Sub

Thanks in advance for any help.
Regards,
Ludo Soete
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bypass: A program is trying to send mail using Item.Send prompt Vick Excel Discussion (Misc queries) 1 June 25th 09 03:31 AM
Mapi Problem Eison Excel Discussion (Misc queries) 0 June 24th 08 01:11 PM
Mapi problem Eison Excel Discussion (Misc queries) 0 June 24th 08 01:02 PM
Excel mail MAPI error DGardner Excel Discussion (Misc queries) 5 June 4th 08 01:58 PM
Send an e-mail Pa Maher Excel Discussion (Misc queries) 1 September 16th 07 04:27 PM


All times are GMT +1. The time now is 10:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"