Using your code (which was missing a lot of Dim's and the sub name) and some parts from a fucntion I found in cyberspace, the below works for me. You need to add back the "recip" so that you can send it to your list of users and change back the 'MailDoc' options I changed. To test sending the email, play the TestSendingEmail sub with your info.
Public Sub TestSendingEmail()
'Example to send an email...
BADSendNotesMail "ghudson", "Testing", "Testing 1 2 3", False, False, "C:\INSTALL.LOG"
End Sub
Public Sub BADSendNotesMail(cRecipient As String, cSubject As String, cBodyText As String, nSaveCopy As Boolean, nNotifySender As Boolean, Optional cAttach1 As String, Optional cAttach2 As String, Optional cAttach3 As String, Optional cAttach4 As String)
Dim Session As Object
Dim MailDBName As String
Dim MailDB As Object
Dim UserName As String
Dim MailDoc As Object
Dim File1 As Object
Dim Attachment1 As Object
Dim File2 As Object
Dim Attachment2 As Object
Dim File3 As Object
Dim Attachment3 As Object
Dim File4 As Object
Dim Attachment4 As Object
Dim recip
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDBName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
Set MailDB = Session.GETDATABASE("", MailDBName)
'Set UIDocument = UIWorkspace.EDITDOCUMENT(True)
If MailDB.ISOPEN = True Then
'Already open for mail
Else
MailDB.OPENMAIL
End If
'Set up the new mail document
Set MailDoc = MailDB.CREATEDOCUMENT
MailDoc.Form = "Memo"
'recip is an array of recipients
MailDoc.SendTo = cRecipient 'recip
MailDoc.Subject = cSubject
MailDoc.Body = cBodyText & vbCrLf & vbCrLf
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.SAVEMESSAGEONSEND = True
'Clean Up
'Sets up the 1st embedded object and attachment and attach it
If cAttach1 <> "" Then
Set File1 = MailDoc.CREATERICHTEXTITEM("cAttach1")
Set Attachment1 = File1.EMBEDOBJECT(1454, "", cAttach1, "cAttach1")
End If
'Sets up the 2nd embedded object and attachment and attach it
If cAttach2 <> "" Then
Set File2 = MailDoc.CREATERICHTEXTITEM("cAttach2")
Set Attachment2 = File2.EMBEDOBJECT(1454, "", cAttach2, "cAttach2")
End If
'Sets up the 3rd embedded object and attachment and attach it
If cAttach3 <> "" Then
Set File3 = MailDoc.CREATERICHTEXTITEM("cAttach3")
Set Attachment3 = File3.EMBEDOBJECT(1454, "", cAttach3, "cAttach3")
End If
'Sets up the 4th embedded object and attachment and attach it
If cAttach4 <> "" Then
Set File4 = MailDoc.CREATERICHTEXTITEM("cAttach4")
Set Attachment4 = File4.EMBEDOBJECT(1454, "", cAttach4, "cAttach4")
End If
'Sends the document
MailDoc.Send 0, cRecipient
'Cleans things Up.
Set MailDB = Nothing
Set MailDoc = Nothing
Set Session = Nothing
Set File1 = Nothing
Set File2 = Nothing
Set File3 = Nothing
Set File4 = Nothing
Set Attachment1 = Nothing
Set Attachment2 = Nothing
Set Attachment3 = Nothing
Set Attachment4 = Nothing
'MsgBox cRecipient
'MsgBox cSubject
'MsgBox cBodyText
End Sub