It is pretty easy if you have VBA routine. Link from IBM site will give you one. And here one from my application:
    Public Function SendNotesMail(strTo As String, _
        strSubject As String, strBody As String, _
        strFileName As String, ParamArray strFiles()) As Boolean
        
         _
         
        Dim doc As Object   
        Dim rtitem As Object 
        Dim Body2 As Object
        Dim ws As Object    
        Dim oSess As Object 
        Dim oDB As Object   
        Dim X As Integer    
     
        Set oSess = CreateObject("Notes.NotesSession")
        
        Set oDB = oSess.GETDATABASE("", "")
        Call oDB.OPENMAIL
     
        
        Set doc = oDB.CREATEDOCUMENT
        Set rtitem = doc.CREATERICHTEXTITEM("Body")
        doc.sendto = strTo
        
        
        doc.Subject = strSubject
        doc.Body = strBody & vbCrLf & vbCrLf
     
        
        If strFileName <> "" Then
            Set Body2 = rtitem.EMBEDOBJECT(1454, "", strFileName)
            If UBound(strFiles) > -1 Then
                For X = 0 To UBound(strFiles)
                    Set Body2 = rtitem.EMBEDOBJECT(1454, "", strFiles(X))
                Next X
            End If
        End If
        doc.SAVEMESSAGEONSEND = True
        doc.SEND False
     
        SendNotesMail = True
    End Function
     
     
     
     
   Labels: Code Samples, VBA
						 
						
						
					  
					  
9 Comments:
hi Alex,
it seems awesome. Is there any possibikity to do the same for
Outlook.
regards,
Roopesh
Hi,
there are plenty of samples, see:
http://support.microsoft.com/kb/209948
and for advanced: http://www.outlookcode.com/
Hi Alex,
Thank you very much!
I need to send 500 different emails and 500 different attachments. Is there a way to do this?
yes, you can send 500 emails using this method
Great help to send bulk emails using Lotus Notes. It seems me the right place to share that Lotus Notes save all our data in NSF file. This NSF file sometimes gets corrupt or becomes inaccessible due to various reasons. But IBM provides no tool that helps us in recovering NSF file so we have to rely on third party nsf file recovery tools.
Where can I use this code, sorry i am a newbie.
I've tried strings, arrays but I can't get the Public Function SendNotesMail to cc more than two people at one time. I've tried these for cc:
array("email1@some.com","email2@some.com","email3@some.com")
and
"email1@some.com","email2@some.com","email3@some.com"
Best I got are the first two get sent. What's up?
try this:
SendNotesMail("email1@some.com;email2@some.com","Subject"...
NSF Repair Kit
A must-have Lotus Notes NSF repair utility for home users and professionals dealing with NSF file corruption on a regular basis.
As it works, is described here: http://www.nsf.repair/
If it doesn't work, then look here: http://www.filerepairforum.com/forum/other/other-aa/lotus-notes/357-how-to-repair-corrupted-nsf-file-in-lotus-notes
Post a Comment
<< Home