Simplest way to send an email from Access using Lotus Notes

bugsy

Registered User.
Local time
Today, 07:57
Joined
Oct 1, 2007
Messages
99
does anyone know what's Simplest way to send an email from Access using Lotus Notes
(no attachment required)
 
check the samples section...
I know outlook is there - but theres a good chance that lotus will be as well
 
check the samples section...
I know outlook is there - but theres a good chance that lotus will be as well

in outlook i've been doing it 5-6 years ago..
it's better then lotus in every respect
 
okay, i see attacment is necessary.
so i put "" , and delete couple of lines, and it works !!
tx !!!
 
You get the error because you don't supply a value for the attachment parameter. You should change the function to not include an attachment parameter.
 
You get the error because you don't supply a value for the attachment parameter. You should change the function to not include an attachment parameter.

yeah, i saw. He wants "" to be included.
I'm fine with that

when i found it fiest and it didn't work i thought maybe it was bad, but after you posted this, decided to try again :)
 
bugsy:

Trying to accomplish the task of sending email thru lotus notes. Having one heck of a time. Is there any way you can send me a sample on how you made it work. Iam trying to make it where the email only fires once when the swithcboard is open to that one user. I think I have that part down. But to have it work with lotus notes is another issue.

any help would be appreciated


thanks
 
bugsy:

Trying to accomplish the task of sending email thru lotus notes. Having one heck of a time. Is there any way you can send me a sample on how you made it work. Iam trying to make it where the email only fires once when the swithcboard is open to that one user. I think I have that part down. But to have it work with lotus notes is another issue.

any help would be appreciated


thanks

sure --

Code:
Private Sub Command213_Click()
'my stuff
    

    

   Call SendNotesMail("", "", "bugsy@bugsy.com", "", vbYes)
End Sub



Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean)
'Set up the objects required for Automation into lotus notes
    
   
    
    Dim FileDate, FileMonth, FileDay, FileYear
    Dim Location As String, FileName As String
    Dim Subfolder As String
    
    FileDate = Date
    Location = "\\sunetrdna02\shared$\Derivatives\CreditMkts\bloomberg\Jeremy\Trade Capture\HYDI\RiskManagementDecomp\Decomp_Check\"
    
    FileYear = Year(Date)
    FileDay = Day(Date)
    FileMonth = Month(Date)
    
    FileName = FileMonth & "." & FileDay & "." & Right(FileYear, 2)
    
   
    
    
    'now file month becomes 3 letter month name - ex "Feb"
    FileMonth = Left(MonthName(2), 3)
    
    
    
    Subfolder = FileMonth & " " & FileYear
    Location = Location & Subfolder & "\RM Decomp " & FileName & ".xls"
    
    
    Attachment = Location
    
     'subject of the email is file name
    Subject = "RM Decomp " & FileName
    
    
    Dim Maildb As Object 'The mail database
    Dim UserName As String 'The current users notes name
    Dim MailDbName As String 'THe current users notes mail database name
    Dim MailDoc As Object 'The mail document itself
    Dim AttachME As Object 'The attachment richtextfile object
    Dim Session As Object 'The notes session
    Dim EmbedObj As Object 'The embedded object (Attachment)
    'Start a session to notes
    Set Session = CreateObject("Notes.NotesSession")
    'Next line only works with 5.x and above. Replace password with your password
   ' Session.Initialize ("")
    'Get the sessions username and then calculate the mail file name
    'You may or may not need this as for MailDBname with some systems you
    'can pass an empty string or using above password you can use other mailboxes.
    UserName = Session.UserName
    MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
    'Open the mail database in notes
    Set Maildb = Session.GETDATABASE("", MailDbName)
     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"
    MailDoc.sendto = Recipient
    MailDoc.Subject = Subject
    MailDoc.Body = BodyText
    MailDoc.SAVEMESSAGEONSEND = SaveIt
    'Set up the embedded object and attachment and attach it
    If Attachment <> "" Then
        Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
        Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
       ' MailDoc.CREATERICHTEXTITEM ("Attachment")
    End If
    'Send the document
    MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
    MailDoc.SEND 0, Recipient
    'Clean Up
    Set Maildb = Nothing
    Set MailDoc = Nothing
    Set AttachME = Nothing
    Set Session = Nothing
    Set EmbedObj = Nothing
End Sub
 
Well bugsy, This is far out of my reach. I can't just figure how to make it work for me. I'am sure there is a way, but I am not good enough to make the code changes.

I have been teaching my self and other help from this form to write code. I can write the simple stuff, but when it gets into this, I am just completly loss. I have struggled with it a couple days and still getting various error messages.

So again thanks ever so much for the code. I will be more than happy to take any suggestions.
 

Users who are viewing this thread

Back
Top Bottom