E-Mail question

greaseman

Closer to seniority!
Local time
Today, 02:31
Joined
Jan 6, 2003
Messages
360
We have an application that sends out thousands of e-mail to our customers. We use a bunch of queries and code to create a file of customers having a valid e-mail address, and then use the DoCmd.SendObject function to send off the e-mails.

In our case, we only send blind copies, so that each recipient doesn't see all of the addresses the mail is sent to. Our problem is that it seems for each e-mail that is bcc'ed, we have to hit the Alt-S key combination from within Outlook to finish sending off the mail.

Here is the code we are trying to work with:

Do Until rsMail.EOF
Do Until lcnt = 100 Or rsMail.EOF
If lcnt = 0 Then
sBCC = rsMail("Email")
Else
Call SysCmd(acSysCmdSetStatus, CStr(lcnt) & " " & rsMail("Email"))
Call WriteFlatFile2("N:\Hey-Sam\WorkingOn\EmailDnrEligBy\Source\EmailDnrEligBy.Log", CStr(lcnt) & " " & rsMail("Email"))
Call WriteLogFile(CStr(lcnt) & " " & rsMail("Email"))
sBCC = sBCC & ";" & rsMail("Email")
End If
lcnt = lcnt + 1
rsMail.MoveNext
Loop
DoCmd.SendObject , , , , , sBCC & "; David Jackson", sSubject, vbCrLf & rsMessage("EmailMessage"), False

lcnt = 0
Loop

****** End of code

Does anyone out there have a hint of what we could or should do to make this thing work completely? If you do, we'd be happy to "see the error of our ways!!"

Thank you...... this forum is great and has saved us lots of time and aggravation. It's the best!
 
to

A string expression that lists the recipients whose names you want to put on the To line in the mail message.
Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon ( ; ) or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel. If the recipient names aren't recognized by the mail application, the message isn't sent and an error occurs.
If you leave this argument blank, Microsoft Access prompts you for the recipients.

Basically this means someone needs to be the receipent (You need to supply the to.)
 
E-mail question

Thanks for your response. I think what you advised was that I need a "to" address (i.e., myself most likely) and then all the bcc "stuff" will work OK. If I don't have a to address, the thing doesn't work, but if I do have a to address, all should be fine.

Is that correct?

And yes, we do have our e-mail address separated as you suggested.

Thanks again!
 
What I put in my response was from the MS Access Help file. SendObjects requires a To (mind you I think the programmers forgot to talk to the Outlook programmers, since Outlook does not require a To if CC or BCC is used :) )
 
Email question

Yeah..... we came to the same conclusion..... :rolleyes: so, what we're going to try is to code some Outlook.Application items that we hope will emulate what Outlook does - our first draft of trying that emulation worked and now we're going to put some "spit and polish" on it and give it a go.

Again, thanks for your quick response! We appreciate it.:)
 

Users who are viewing this thread

Back
Top Bottom