e-mail using Lotus Notes

D

DavPet

I am sending reports to Lotus Notes as Snapshots.
How can I send 5 reports in one e-mail?
How can I create a Snapshot of all 5 reports that I could send in one
e-mail?
 
S

Silvester

For Lotus Notes try
http://www.utteraccess.com/forums/s...=m&olderval=&oldertype=#Post1042460&bodyprev=

Here's a code alternative for multiple attachments that I've got working if
anyone else is interested. This works with attachments for mapi clients.

Invoke by using:

Call SendMailWithOE("Subject", "BODY", "(e-mail address removed)", "full path and
..format to attachment1" & "," & "full path and .format to attachment2")

_______________________________________________________________________
Option Compare Database
Option Explicit


Private Type MapiRecip
Reserved As Long
RecipClass As Long
Name As String
Address As String
EIDSize As Long
EntryID As Long
End Type
Private Type MAPIFileDesc
Reserved As Long
Flags As Long
Position As Long
PathName As String
FileName As String
FileType As Long
End Type
Private Type MAPIMessage
Reserved As Long
Subject As String
NoteText As String
MessageType As String
DateReceived As String
ConversationID As String
Originator As Long
Flags As Long
RecipCount As Long
Recipients As Long
FileCount As Long
Files As Long
End Type
Private Declare Function MAPISendMail _
Lib "C:\Program Files\Outlook Express\msoe.dll" ( _
ByVal Session As Long, _
ByVal UIParam As Long, _
Message As MAPIMessage, _
ByVal Flags As Long, _
ByVal Reserved As Long) As Long
Sub SendMailWithOE(ByVal vSubject As String, _
ByVal vMessage As String, _
ByRef vRecipients As String, _
Optional ByVal vFiles As String)
Dim aFiles() As String
Dim aRecips() As String
Dim FilePaths() As MAPIFileDesc
Dim Recips() As MapiRecip
Dim Message As MAPIMessage
Dim z As Long
aFiles = Split(vFiles, ",")
ReDim FilePaths(LBound(aFiles) To UBound(aFiles))
For z = LBound(aFiles) To UBound(aFiles)
With FilePaths(z)
..Position = -1
..PathName = StrConv(aFiles(z), vbFromUnicode)
End With
Next z
aRecips = Split(vRecipients, ",")
ReDim Recips(LBound(aRecips) To UBound(aRecips))
For z = LBound(aRecips) To UBound(aRecips)
With Recips(z)
..RecipClass = 1
If InStr(aRecips(z), "@") <> 0 Then
..Address = StrConv(aRecips(z), vbFromUnicode)
Else
..Name = StrConv(aRecips(z), vbFromUnicode)
End If
End With
Next z
With Message
..FileCount = UBound(FilePaths) - LBound(FilePaths) + 1
..Files = VarPtr(FilePaths(LBound(FilePaths)))
..NoteText = vMessage
..RecipCount = UBound(Recips) - LBound(Recips) + 1
..Recipients = VarPtr(Recips(LBound(Recips)))
..Subject = vSubject
End With
MAPISendMail 0, 0, Message, 0, 0
End Sub




Sub sendOEEMail()

'Error-handler inserted on 10/26/2005 '

On Error GoTo sendOEEMail_Error

Call SendMailWithOE("Subject", "BODY", "(e-mail address removed)", "full path and
..format to attachment1" & "," & "full path and .format to attachment2")


sendOEEMail_Exit:
SetDefaultPrinter (currPrinter)
Exit Sub

sendOEEMail_Error:

Select Case Err.Number

Case Else
MsgBox "Error - " & Err.Number & vbCrLf & vbCrLf & Error$, vbExclamation,
GetAppName()

End Select

Resume sendOEEMail_Exit

End Sub
 
D

DavPet

Thanks. Really good information.

Silvester said:
For Lotus Notes try
http://www.utteraccess.com/forums/s...=m&olderval=&oldertype=#Post1042460&bodyprev=

Here's a code alternative for multiple attachments that I've got working
if
anyone else is interested. This works with attachments for mapi clients.

Invoke by using:

Call SendMailWithOE("Subject", "BODY", "(e-mail address removed)", "full path and
.format to attachment1" & "," & "full path and .format to attachment2")

_______________________________________________________________________
Option Compare Database
Option Explicit


Private Type MapiRecip
Reserved As Long
RecipClass As Long
Name As String
Address As String
EIDSize As Long
EntryID As Long
End Type
Private Type MAPIFileDesc
Reserved As Long
Flags As Long
Position As Long
PathName As String
FileName As String
FileType As Long
End Type
Private Type MAPIMessage
Reserved As Long
Subject As String
NoteText As String
MessageType As String
DateReceived As String
ConversationID As String
Originator As Long
Flags As Long
RecipCount As Long
Recipients As Long
FileCount As Long
Files As Long
End Type
Private Declare Function MAPISendMail _
Lib "C:\Program Files\Outlook Express\msoe.dll" ( _
ByVal Session As Long, _
ByVal UIParam As Long, _
Message As MAPIMessage, _
ByVal Flags As Long, _
ByVal Reserved As Long) As Long
Sub SendMailWithOE(ByVal vSubject As String, _
ByVal vMessage As String, _
ByRef vRecipients As String, _
Optional ByVal vFiles As String)
Dim aFiles() As String
Dim aRecips() As String
Dim FilePaths() As MAPIFileDesc
Dim Recips() As MapiRecip
Dim Message As MAPIMessage
Dim z As Long
aFiles = Split(vFiles, ",")
ReDim FilePaths(LBound(aFiles) To UBound(aFiles))
For z = LBound(aFiles) To UBound(aFiles)
With FilePaths(z)
.Position = -1
.PathName = StrConv(aFiles(z), vbFromUnicode)
End With
Next z
aRecips = Split(vRecipients, ",")
ReDim Recips(LBound(aRecips) To UBound(aRecips))
For z = LBound(aRecips) To UBound(aRecips)
With Recips(z)
.RecipClass = 1
If InStr(aRecips(z), "@") <> 0 Then
.Address = StrConv(aRecips(z), vbFromUnicode)
Else
.Name = StrConv(aRecips(z), vbFromUnicode)
End If
End With
Next z
With Message
.FileCount = UBound(FilePaths) - LBound(FilePaths) + 1
.Files = VarPtr(FilePaths(LBound(FilePaths)))
.NoteText = vMessage
.RecipCount = UBound(Recips) - LBound(Recips) + 1
.Recipients = VarPtr(Recips(LBound(Recips)))
.Subject = vSubject
End With
MAPISendMail 0, 0, Message, 0, 0
End Sub




Sub sendOEEMail()

'Error-handler inserted on 10/26/2005 '

On Error GoTo sendOEEMail_Error

Call SendMailWithOE("Subject", "BODY", "(e-mail address removed)", "full path and
.format to attachment1" & "," & "full path and .format to attachment2")


sendOEEMail_Exit:
SetDefaultPrinter (currPrinter)
Exit Sub

sendOEEMail_Error:

Select Case Err.Number

Case Else
MsgBox "Error - " & Err.Number & vbCrLf & vbCrLf & Error$, vbExclamation,
GetAppName()

End Select

Resume sendOEEMail_Exit

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top