When I use the sendobject to send emails from an Access DB to an email address, it automatically opens an email memo pad (I use Lotus Notes) requiring me to hit the "Send" button. I had hoped that Access would automatically send out the emails without requiring me to hit the "Send" each time I request it to send an email. Is there a way around this??
And how can I automate the sending of this email every 60 days?
1 2206
Ok I figured out how to solve this. But I am having another dilemma: how can I attach the results of a query, "qryAccessDate" , to this email so that it shows up in the body of the email in HTML format. For instance with sendobjects this was how I accomplished the task: -
DoCmd.SendObject acQuery, "qryPasswordsAboutToExpire", "HTML(*.html)", "MyBoss@aol.com", "", "", _
-
"Users With Passwords About to Expire", "The Passwords of the following " & _
-
"Users will expire within 5 days!", True, ""
-
But my question is how is this done in Lotus Notes without using sendobject?
Here's code for a basic lotus notes email from an Access DB: -
Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean)
-
'This public sub will send a mail and attachment if neccessary to the recipient including the body text.
-
'Requires that notes client is installed on the system.
-
-
'Set up the objects required for Automation into lotus notes
-
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")
-
-
'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
-
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.Send 0, Recipient
-
-
'Clean Up
-
Set Maildb = Nothing
-
Set MailDoc = Nothing
-
Set AttachME = Nothing
-
Set Session = Nothing
-
Set EmbedObj = Nothing
-
End Sub
-
* Could someone also show me how to automate the sending of emails using the above code? I wish to send out emails every 60 days.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Mike |
last post by:
Is there a way to determine what a user's default email client is? I
read a post from 3 years ago that said no. I guess I'm hoping
something has come along since then.
|
by: PZ Fosbeck |
last post by:
I'm not a Lotus Notes developer but thanks to this group's archives
have successfully created a function for sending Lotus Notes emails
from Access.
The follow code works great except I want to remove my name from the
'Sent By' portion of the email.
These messages are sent using my client session of Lotus Notes, using
a database called 'Tech Team' The resulting email message headers
contains
(Bold, the From name) 'Tech Team'
|
by: Nicole |
last post by:
Hello! I hope there is someone out there who can shed some light on
this for me. I have a module that is supposed to look at an access
table, pull out each bid record, link to another table to find all of
the people to send the email to and link to one more table to find who
should be cc'd on the note.
All of this works fine, except.... The arrays for the To and CC seem
to exclude names from the list if there are multiple recipients...
|
by: moid |
last post by:
I want to Email through Lotus Notes Server. Am i right on this that i wont
be needing any lotus notes based assembly/dll to email through it
I hope i just have to do is that to have smtpserver name to where lotus
notes is installed
Regards
Moid Iqbal
|
by: navyliu |
last post by:
I want send Lotus Notes Email automatic in my Application.I googled this
topic but I can't find the solution.
Does anyone have ever use this function?Can you give me some advice? Thanks
a lot!
| |
by: =?Utf-8?B?SmFtZXNU?= |
last post by:
I can create a message and send it via my btopenworld account but is the
method the same when using Lotus Notes.
I have no experience of Lotus Notes whatsoever. I have never seen it at all.
the code I am using is:
dim smtp as new smtpclient
dim message as new mailmessage( from@cc.com, to@dd.com)
message.subject = "test"
|
by: kohligagan2 |
last post by:
Hi,
I am working on a scenario . And scenario is I am trying to send an Email using my Lotus notes Client Id ( Lotus notes :- is used for messaging and sending mails work as a middleware)
I have an ASP .NET website running on a IIS Server with Lotus note is running at the machine where server is running.
One client sends the request to the server and correspondingly mail goes to the respective person as mentioned.
I am using a...
|
by: MarkStorer |
last post by:
Hi All
I need to email a report (with contains graphs) via Lotus Notes. I've tried the 'SendObjectSnp' method (which works with some Lotus Notes clients (but not many others)); so I used the code below: -
Public Sub SEND_EMAILS()
Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
|
by: jambonjamasb |
last post by:
Hi
I have two tables:
email_tbl
Data_table
Data table is is used to create a Form
Data_form
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |