473,804 Members | 3,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email (Lotus Notes) Issues

33 New Member
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?
Jul 21 '08 #1
1 2206
owuraku
33 New Member
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:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SendObject acQuery, "qryPasswordsAboutToExpire", "HTML(*.html)", "MyBoss@aol.com", "", "", _
  2.                           "Users With Passwords About to Expire", "The Passwords of the following " & _
  3.                           "Users will expire within 5 days!", True, ""
  4.  
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:

Expand|Select|Wrap|Line Numbers
  1. Public Sub SendNotesMail(Subject As String, Attachment As String, Recipient As String, BodyText As String, SaveIt As Boolean)
  2. 'This public sub will send a mail and attachment if neccessary to the recipient including the body text.
  3. 'Requires that notes client is installed on the system.
  4.  
  5. 'Set up the objects required for Automation into lotus notes
  6. Dim Maildb As Object 'The mail database
  7. Dim UserName As String 'The current users notes name
  8. Dim MailDbName As String 'THe current users notes mail database name
  9. Dim MailDoc As Object 'The mail document itself
  10. Dim AttachME As Object 'The attachment richtextfile object
  11. Dim Session As Object 'The notes session
  12. Dim EmbedObj As Object 'The embedded object (Attachment)
  13.  
  14. 'Start a session to notes
  15. Set Session = CreateObject("Notes.NotesSession")
  16.  
  17. 'Get the sessions username and then calculate the mail file name.
  18. 'You may or may not need this as for MailDBname with some systems you can pass an empty string
  19. UserName = Session.UserName
  20. MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
  21.  
  22. 'Open the mail database in notes
  23. Set Maildb = Session.GETDATABASE("", MailDbName)
  24. If Maildb.ISOPEN = True Then
  25. 'Already open for mail
  26. Else
  27. Maildb.OPENMAIL
  28. End If
  29.  
  30. 'Set up the new mail document
  31. Set MailDoc = Maildb.CREATEDOCUMENT
  32. MailDoc.Form = "Memo"
  33. MailDoc.sendto = Recipient
  34. MailDoc.Subject = Subject
  35. MailDoc.Body = BodyText
  36. MailDoc.SAVEMESSAGEONSEND = SaveIt
  37.  
  38. 'Set up the embedded object and attachment and attach it
  39. If Attachment <> "" Then
  40. Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment")
  41. Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")
  42. MailDoc.CREATERICHTEXTITEM ("Attachment")
  43. End If
  44.  
  45. 'Send the document
  46. MailDoc.Send 0, Recipient
  47.  
  48. 'Clean Up
  49. Set Maildb = Nothing
  50. Set MailDoc = Nothing
  51. Set AttachME = Nothing
  52. Set Session = Nothing
  53. Set EmbedObj = Nothing
  54. End Sub
  55.  
* 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.
Jul 21 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

88
12583
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.
0
5617
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'
1
4495
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...
0
1016
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
4
9988
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!
3
8278
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"
0
1798
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...
2
3977
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
3
3018
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
0
9706
marktang
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...
0
9582
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,...
0
10335
jinu1996
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...
0
10082
tracyyun
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...
0
9157
agi2029
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...
0
6854
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();...
0
5525
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...
0
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.