473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VB: Lotus Notes Emaling to a BCC

I have an Access form that will automatically send out Emails through Lotus. Works like a charm for the sendto and the copyto. Is there a way I can also utilize the "blind copy to"? I appreciate any guidance! Thanks!

I tried to follow the same logic of the copy to, but can't seem to get it to work.

Note: The CopyName (ie. copy to) works already, but I tried to add BlindCopyName in also and can't get it to work.

I set all the variables here:

Dim SendContactName As String, SendCopyName As String, SendBlindCopyName As String, msg As String, SendSubject As String
Dim SendType As String
Dim db As DAO.Database

DoCmd.SetWarnings False
Set db = CurrentDb

Then I assign the variables for CopyName and a new variable I call BlindCopyName:

If IsNull(Forms!frmEdit!txtemail_pm) Then
Forms!frmEdit!txtemail_pm = "Nobody"
Else
SendCopyName = Forms!frmEdit!txtemail_pm ' This was Me.CopyName
End If

If IsNull(Forms!frmEdit!txtemail_hq) Then
Forms!frmEdit!txtemail_hq = "Nobody"
Else
SendBlindCopyName = Forms!frmEdit!txtemail_hq
End If

Next, I pass the variable to the email function, which I call:

Call SendStatusReport(SendContactName, SendCopyName, SendBlindCopyName, msg, SendSubject)

Finally, this is my Email Sub:

Public Sub SendStatusReport(ContactName, CopyName, BlindCopyName, Msgs, Subject)

Dim mailDb As Object, Attachment As String

Dim UserName As String, Recipient As Variant, Recipient2 As Variant

Dim MailDbName As String

Dim mailDoc As Object

Dim AttachME As Object

Dim Session As Object

Dim EmbedObj As Object

Dim db As DAO.Database

Dim rs As DAO.Recordset

Dim rc As Long, strUn As String, nSize As Long, rec As Long

Dim strTitle As String

'Dim recip(25) As Variant

On Error GoTo NoSend

Set Session = CreateObject("notes.NotesSession")

UserName = Session.UserName

Set mailDb = Session.GETDATABASE("", "")

On Error Resume Next

If mailDb.IsOpen = True Then

Else

Call mailDb.OPENMAIL

End If

Set mailDoc = mailDb.CREATEDOCUMENT

mailDoc.Form = "Memo"

Recipient = ContactName

mailDoc.sendto = Recipient

Recipient2 = BlindCopyName

mailDoc.blindcopyto = Recipient2

If IsNull(CopyName) Then

mailDoc.copyto = "Nobody"

Else

mailDoc.copyto = CopyName

End If

If IsNull(BlindCopyName) Then
mailDoc.blindcopyto = "Nobody"
Else
mailDoc.blindcopyto = BlindCopyName
End If


Attachment = "c:\temp\ProjectStatusUpdate.rtf"

Set AttachME = mailDoc.CREATERICHTEXTITEM(Attachment)

Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", Attachment, "Attachment")

mailDoc.CREATERICHTEXTITEM ("Attachment")

Dim frmSubject As String
Dim frmBody As String

frmSubject = "Task Reminder for: " & Subject

frmBody = "This is a system generated email notifying you that the Project (referenced in the subject of this email)" & vbCrLf & "has had a Status Level update or change."

frmBody = frmBody & vbCrLf & vbCrLf & Msgs & vbCrLf

mailDoc.Subject = frmSubject

mailDoc.Body = frmBody

mailDoc.SAVEMESSAGEONSEND = True

mailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder

mailDoc.Send 0, Recipient

'Call mailDoc.Save(True, False)


NoSendExit:

Set mailDb = Nothing

Set mailDoc = Nothing

Set AttachME = Nothing

Set Session = Nothing

Set EmbedObj = Nothing

Exit Sub


NoSend:

MsgBox "Error sending mail. Check your Send Folder under Lotus Notes to see if the email was sent.", , "Problem Sending Email"

GoTo NoSendExit

End Sub
Apr 23 '07 #1
1 8488
pks00
280 Expert 100+
blindcopyto should be working for you

there is a slightly different way as demonstrated here in sending emails. Try this method, see if it helps any

http://www.bygsoftware.com/Excel/VBA...otus_notes.htm
Apr 26 '07 #2

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

Similar topics

5
by: NickBlooruk | last post by:
Hello, I have successfully linked a Lotus Notes server to our SQL Server database using an ODBC connection. This works fine when wanting to select records eg openquery(LOTUSNOTES2, 'select *...
10
by: hrishy | last post by:
Hi I have heard rumors that Lotus notes would be moving to db2 as the datastore..would that mean db2 for windows and Linux have a shot in its arm and become as pervasive as oracle and ms-sql...
5
by: Colin Anderson | last post by:
I discovered, with great excitement, this article http://www.davison.uk.net/vb2notes.asp when researching methods for emailing from Access via Notes. Unfortunatly, when I run this I get a...
0
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...
1
by: Joe | last post by:
HI Has anyone been able to work with lotus notes automation classes??? Can you post sample code of how to use these classes. I have setup in VB but I am not able to port to C# This is what I...
3
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. ...
0
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...
2
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...
4
by: Bob Alston | last post by:
I am trying to access data in a Lotus Notes database, from Access. The Notes database is release R5. I installed NotesSQL 8.x and have it working. However it chokes on one of the tables and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...

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.