How to Send Email - Lotus Notes Automation Classes using Visual Basic?-VBForums
Results 1 to 5 of 5

Thread: How to Send Email - Lotus Notes Automation Classes using Visual Basic?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    India
    Posts
    21

    Question

    Can anyone please tell me how to send Email of Lotus Notes 4.5 using Visual Basic.Lotus Notes provides an Automation class for this purpose.But I am unable to create an Object of that class.
    Please Help me.
    Thomas Mathews

  2. #2
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138

    Question

    Are you asking how to send an e-mail from VBScript, or how to send the Lotus Notes Program to someone with VBScript, or how to use Lotus Notes Program to send someone an e-mail?
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net-****^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    India
    Posts
    21

    Question Lotus Notes Email

    I am Having VB6 and Lotus Notes Notes installed in My PC. I can directly send Email using Lotus Notes.But I want to send Email through VB6 codes using Lotus Notes Automation Classes.
    Lotus Notes Provides notes32.tlb file for this purpose.It has many classes inside ,properties and methods
    which can be used.But to access all this I need to create an Object of that Class.But I am getting an error like Activex Component cant't Create Object. and program stops executing at this line
    Set s = CreateObject("lotus.NOTESSESSION")
    Please helpme.

    An Example of the code which I have used for getting the number of documents created before 1/1/99.


    Sub Macro1()
    Dim s As lotus.NOTESSESSION
    Dim db As NOTESDATABASE
    Dim vw As NOTESVIEW
    Dim doc As NOTESDOCUMENT
    Dim createtime As Date
    Dim doccount As Integer
    Set s = CreateObject("lotus.NOTESSESSION")
    Set db = s.CURRENTDATABASE
    Set vw = db.GETVIEW("Myview")
    Set doc = vw.GETFIRSTDOCUMENT
    Do Until doc Is Nothing
    createtime = doc.CREATED
    If (createtime > #1/1/99#) Then
    doccount = docount + 1
    End If
    Set doc = vw.GETNEXTDOCUMENT(doc)
    Loop
    MsgBox (CStr(doccount) + "documents were created before 1/1/99.")

    End Sub



    Thomas Mathews

  4. #4
    Addicted Member Mage33's Avatar
    Join Date
    Aug 2000
    Location
    Petaluma, California
    Posts
    138

    Talking

    Aah, well, I can't help you there but I can give you a short little function which will let you send e-mail from your address if you want:

    Function MailThis(strSubject, strBody)

    Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
    Mailer.FromName = sender name
    Mailer.FromAddress= sender address
    Mailer.RemoteHost = "Mail sever"
    Mailer.AddRecipient "To's Name","To's Address"
    Mailer.AddCC "CC's Name","CC's Address"
    Mailer.Subject = strSubject
    Mailer.BodyText = strBody
    End Function

    I hope that helps!
    Stephen Haney- 115 116 101 118 101 31 72 65 78 69 89
    -ShardsOfSilence.net-****^ My name in ASCII ^
    You forget something new every day
    | WinME | VB6 Pro | MSC++ | Lambda MOO |

  5. #5
    New Member
    Join Date
    Sep 2000
    Posts
    1

    Your Missing Some vital code

    Before you can use Lotus Notes back end classes you must do a NotesSession.Initialize to start the connection between VB and Lotus Notes.

    Darryl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.