Send Email from VB5 to Lotus Notes 
Author Message
 Send Email from VB5 to Lotus Notes

I am currently writing an application using VB 5.0. I need to send some
Email via

This a part of my code:

Set myDoc = myDB.createDocument
Set myItem = myDoc.ReplaceItemValue("Subject", "VB-Test")
Set myItem = myDoc.ReplaceItemValue("SendTo", "CN=Patrick

Set myItem = myDoc.ReplaceItemValue("Form", "Memo")

myDoc.send                <===  Type mismatch

Thanks in advance for your help


Fri, 14 Jul 2000 03:00:00 GMT  
 Send Email from VB5 to Lotus Notes

I tried your solution, but I could not make it work.... This code works with
Lotus Notes 4.52

Public Function SendEmail(rsReceipients() As String, rsSubject As String,
rsAttachment As String, rsMsg As String) As Boolean

    Dim oSession As Object
    Dim oDB As Object
    Dim oDoc As Object
    Dim oItem As Object

On Error GoTo SendmailErrHandler

    Set oSession = CreateObject("Notes.Notessession")   'create notes
    Set oDB = oSession.GETDATABASE("", "")                    'set db to
database not yet named
'set database to default mail database
    oDoc.Subject = rsSubject
    oDoc.BODY = rsMsg

    If Trim(rsAttachment) <> "" Then    'Make sure it is not an empty path
        If Dir$(rsAttachment) <> "" Then  'Make sure the file exists
            Set oItem = oDoc.CREATERICHTEXTITEM("Attachment")
            oItem.EMBEDOBJECT 1454, "", rsAttachment            'Const 1454
means Embeded attachment
        End if
    End If

    oDoc.SEND 0, rsReceipients()    'String Array of repient names

    'Destroy objects before closing
    Set oItem = Nothing
    Set oDoc = Nothing
    Set oDB = Nothing
    Set oSession = Nothing
    SendEmail = True

Exit Function


    Msgbox "Failed to send mail"

End Function

Good Luck.

Lyle Edwards MCSD


>I am currently writing an application using VB 5.0. I need to send some
>Email via

>This a part of my code:

>Set myDoc = myDB.createDocument
>Set myItem = myDoc.ReplaceItemValue("Subject", "VB-Test")
>Set myItem = myDoc.ReplaceItemValue("SendTo", "CN=Patrick

>Set myItem = myDoc.ReplaceItemValue("Form", "Memo")

>myDoc.send                <===  Type mismatch

>Thanks in advance for your help


Fri, 14 Jul 2000 03:00:00 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Send email from Acc97 to Lotus notes email.

2. VBA code to send an email message through Lotus Notes mail interface

3. Sending email via Lotus Notes

4. Sending Email with Lotus Notes

5. Creating but not sending a Lotus Notes email

6. Sending email to lotus notes from VB

7. VB5.0 & Lotus Notes email - recommendations Please

8. Sending e-mails with MAPI from VB5 on system using Lotus Notes

9. How to Send Mail From VB5.0 to Lotus Notes

10. Help - Creating a Lotus Notes Document in a local Lotus Notes DB with VB6

11. Lotus Notes Email.

12. Pull Email form Lotus Notes Server


Powered by phpBB® Forum Software