how do i get lotus to send email automatically??

J

jo

I have scheduler task to open access program (works ok!), then access does a
check to find overdue items then create a report to email (works ok!!), when
access opens lotus notes it attaches the report (works ok!!) BUT then sits
there waiting for the user to click on send email?? I want the email to send
with out the user clicking on send button, does en of you guys no how to do
this?? some coding mayb for access???
Jo
 
B

broro183

B

broro183

hi Jo,

I thought it may have been a long shot, as the previous times I have
seen this code used it was via VBA in Excel. However, I'd assumed that
Access would probably use the same or similar object declarations. Does
the below work (esp the lines marked with stars)?


Code:
--------------------

'...
'sourced from 'Send worksheets to several recipients' (http://www.excelkb.com/article.aspx?id=10221&cNode=1X5M7A)...
'Instantiate the Lotus Notes COM's Objects.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GETDATABASE("", "")

'If Lotus Notes is not open then open the mail-part of it.
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL

'Create the e-mail and add the attachment.
Set noDocument = noDatabase.CreateDocument
Set noAttachment = noDocument.CreateRichTextItem("stAttachment")
Set noEmbedObject = noAttachment.EmbedObject(EMBED_ATTACHMENT, "", stAttachment)

'Add values to the created e-mail main properties (change variables as needed).
With noDocument
.Form = "Memo"
.SendTo = vaRecipients
.Subject = stSubject
.Body = vaMsg
.SaveMessageOnSend = True
.PostedDate = Now() '****
.Send 0, vaRecipients '****
End With
'rest of code to release objects etc...

--------------------


If the above doesn't help, can you please paste in the code you have so
far?
With more context, I or others may be able to help more effectively.

Another possibility is that you need to change an internal Lotus Notes
(or control panel?) setting to allow the Access code to work...?

hth
Rob
 
J

jo

Hi Rob thanks for yr reply this is my coding for Access to check for Overdue
items and if yes send the report. I have Outlook on my laptop and apart form
the dialog telling me that an email is being sent (which is a pain!!) the
email then gets sent off. But at my works its Lotus Notes and the coding
stops for the user to click send??,
Option Compare Database

'------------------------------------------------------------
' checker_Query_overdue
'
'------------------------------------------------------------
Function checker_Query_overdue()
On Error GoTo checker_Query_overdue_Err

If (DCount("*", "OnOpenOverdue") > 0) Then
DoCmd.SendObject acReport, "OnOpenOverdue", "SnapshotFormat(*.snp)",
"(e-mail address removed)", "", "", "Gauge Control", "Gauges Overdue",
False, ""
End If
If (DCount("*", "OnOpenOverdue") = 0) Then
Beep
MsgBox "No Gauges found overdue today..", vbOKOnly, "No Gauges
found.."
End If


checker_Query_overdue_Exit:
Exit Function

checker_Query_overdue_Err:
MsgBox Error$
Resume checker_Query_overdue_Exit

End Function

P.S I have an AutoExec to start this coding which is a macro, I have just
copied the coding for you. Hope you can help Jo
 
B

broro183

hi Jo,

I've done some Googling for you & have found that .SendObject doesn't
work well with Lotus Notes (see 'Using MS Access: Microsoft Access and
Lotus Notes, lotus notes version, outlook exchange'
(http://tinyurl.com/m6lm2t), or
'Emailing from Access 2003'
(http://www.pcreview.co.uk/forums/thread-3335406.php), or
http://tinyurl.com/n3nnwu(includes an alternative approach which will
hopefully remove your need of pressing the send button).

With these comments in mind, here's an alternative approach to
..sendObject 'Sending an Email via Lotus Notes'
(http://www.granite.ab.ca/access/email/lotusnotessample.htm)
or 'VB and VBA - Lotus Notes Send Email from VB or VBA'
(http://www.fabalou.com/VBandVBA/lotusnotesmail.asp)


Here are some more useful (?) links - I'll leave the reading to you ;)
:'Microsoft Access Email FAQ - Lotus Notes'
(http://www.granite.ab.ca/access/email/lotusnotes.htm)
'MS Access :: Send Email With Either Outlook Or Lotus Notes - Version:
2002 (10.0) XP' (http://tinyurl.com/m8exrv)

'JACKPOT from IBM!' (http://tinyurl.com/mb2zgy)
(in case the link doesn't work, I searched for "sendobject" under
"Lotus Notes" which gave 3 links including the above)
This link states:
In the example above, the EditMessage parameter is set to False (in
bold). Despite this, the memo opened in the Notes client for editing.


Answer
This issue was reported to Quality Engineering as SPR# DPOL697GHL.
Make sure that the customer has applied the Microsoft security fix
('Microsoft KB article #262997'
(http://support.microsoft.com/kb/262997)) and is not encountering the
known Access 2000 issue ('Microsoft KB article #260819'
(http://support.microsoft.com/kb/260819/)).

As a workaround, use Visual Basic to send a memo. Refer to the
following 'Document #1178583'
(http://www.ibm.com/support/docview.wss?rs=899&uid=swg21178583), "How to
send Lotus Notes mail messages with Microsoft Visual Basic."

I really hope this helps, as I've done my dash now :)
Rob

Others, please note this is a duplicate thread,
http://tinyurl.com/mxfdum
 

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