How do I auto e-mail from Access without using Outlook?

G

Guest

My company has been using Outlook for years and I have a database that has
been utilizing Outlook to automatically send out a report to amail group for
almost as many. Well my company switched to Lotus Notes Domino w/e-mail and
stopped Outlook. Needless to say my MS Access program stopped auto e-mailing.
I am completely unfamiliar with Lotus Notes and their e-mail system and have
had little to no luck locating anyone here at my company who can or are
willing to help. Is there anyone out there that knows how I can set up Access
to automatically send e-mail to a mail group using Domino e-mail (Lotus
notes)? If so how then can I make this happen?
 
G

Guest

I'm not sure if the domino server is applicable here, but if you have Lotus
notes on your PC, you can use certain function calls to send email
automatically without opening a session physically using MS Access. the
function below should work.

Public Function sendDeviationRequest()
On Error GoTo sendErr


Dim strCurrentPath As String

Dim notesdb As Object
Dim notesdoc As Object
Dim notesrtf As Object
Dim notessession As Object

' Recipients Arrays
Dim ArSendToRecipients(10) As String 'Sett this as array for multiple
recipients
Dim ArCopyToRecipients(10) As String 'Set as array for mult. recip
Dim ArBlindCopyToRecipients(10) As String 'Set as array for mult recip.

strCurrentPath = "Your path and filename of attachment"

Set notessession = CreateObject("Notes.Notessession")
Set notesdb = notessession.GETDATABASE("", "")
Call notesdb.OPENMAIL
Rem make new mail message
Set notesdoc = notesdb.CREATEDOCUMENT

Call notesdoc.REPLACEITEMVALUE("Sendto", ArSendToRecipients)
Call notesdoc.REPLACEITEMVALUE("Copyto", ArCopyToRecipients)
Call notesdoc.REPLACEITEMVALUE("BlindCopyto", ArBlindCopyToRecipients)

Call notesdoc.REPLACEITEMVALUE("Subject", "Subject Description Here")
Set notesrtf = notesdoc.CreateRichTextItem("body")
Call notesrtf.addnewline(2)
'Attach file to email
Call notesrtf.EmbedObject(1454, "", strCurrentPath,
getFileName(strCurrentPath))

notesdoc.SaveMessageOnSend = True
notesdoc.Visible = True
Call notesdoc.Save(True, False)

Call notesdoc.Send(False)
Set notessession = Nothing

MsgBox "Your Report was sent"

Exit_sendDeviationRequest:
Exit Function

sendErr:
MsgBox Err.Description
Resume Exit_sendDeviationRequest

End Function

Hope this helps....

Don't ask about adding more than 2 attachments becuase I've never been able
to attach more than 2 to an email via code. I'm working that issue as I
write....

Good Luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top