473,320 Members | 1,612 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,320 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 8479
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.