Erwin Craps - IT Helps
Erwin.Craps at ithelps.be
Fri Mar 18 01:23:16 CST 2005
This is the code for dooing that
Notice I also add customer company, last and first names, I find it more
personal that if the display name is set correctly, but it's not
obligated.
Dim mItem As Outlook.MailItem
'... Other code
Set mRecip = mItem.Recipients.Add(rs.Fields("Company") & "-" &
rs.Fields("Firstname") & " " & rs.Fields("surname") & " " &
rs.Fields("Email"))
mRecip.Type = olBCC
mRecip.Resolve
Set mRecip = Nothing
As already said by stuart, keep in mind that the SMTP server that u use
to relay your mails can have a maximum of x recipients (all in to, cc
and bcc).
If our company has an own SMTP server, ask your mail administrator.
If u use the ISP SMTP server, ask your ISP.
My ISP for example supports up to 999 recipients in 1 mail.
Greetings
Erwin
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Friday, March 18, 2005 1:45 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] A2003: Outlook not working using redemption
-DESPERATE
HI Charlotte
Thanks for the reply
This application potentially will be sending out multiples of hundreds
(In one circumstance even thousands) of emails - No it's not spam :-))
So instead of using .To = rs!EmailAddress in the RS loop I can build a
string of recipients by typing .Recipients.Add rs!EmailAddress somewhere
in the RS loop Then at the end of the loop have something like .BCC =
.recipients
Is that right?
So instead of sending multiple of hundreds, just send one with hundreds
of BCC's
Cool
Many thanks
Darren
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
Foust
Sent: Friday, 18 March 2005 10:27 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] A2003: Outlook not working using redemption
-DESPERATE
I'm not sure I understand the question. It will create one email with
all the To addresses, but each addressee will get an email showing all
the To addresses, and I don't think you would want that. We use this in
our applications when a report is being sent to a number of different
email addresses. We certainly don't create an email for each, but we
also don't send a hundred of them at once! An alternative would be to
added the recipients to the BCC, which only shows the individual
addressee their own address.
Charlotte Foust
-----Original Message-----
From: Darren DICK [mailto:d.dick at uws.edu.au]
Sent: Thursday, March 17, 2005 2:05 PM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] A2003: Outlook not working using redemption
-DESPERATE
Hi All
Many thanks for the responses
Andy's suggestion was the answer
I was only setting up the email once
I had to put it 'in the loop' so to speak
Thanks to Erwin and Charlotte too for the info on resolving
Charlotte I see in your response you have the line
omsg.Recipients.Add rs!EmailAddress Does this mean I can build
the string of addresses then push it out as one Super email or will it
still 'produce' 100 emails if there are 100 email addresses?
Many thanks
Andy - you da man
SYWYE
Darren
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte
Foust
Sent: Friday, 18 March 2005 3:59 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] A2003: Outlook not working using redemption
-DESPERATE
It works the same way with Redemption. You must resolve the recipients.
omsg.Recipients.Add rs!EmailAddress
omsg.Recipients.ResolveAll
Charlotte Foust
-----Original Message-----
From: Erwin Craps - IT Helps [mailto:Erwin.Craps at ithelps.be]
Sent: Thursday, March 17, 2005 1:16 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] A2003: Outlook not working using redemption
-DESPERATE
Don't know redemption but I had some problems with Outlook 11
The e-mailadresses need to be resolved BEFORE sending.
This can be done with
mItem.Recipients.ResolveAll
(mItem is a Outlook mailitem)
Also I noticed there is a bug in Outlook with this resolve thing. When
the new message is hidden the recipients do not resolve. So you first
need to display the message and resolve again...
I noticed that the folowing code works fine for me.
mItem.Display 'Needed to resolve: bug??? mItem.Recipients.ResolveAll
Debug.Print mItem.Recipients.ResolveAll Do While
mItem.Recipients.ResolveAll = False
DoEvents
Debug.Print "Waiting for recipients resolve."
mItem.Recipients.ResolveAll
Loop
mItem.Send
Please bare in mind this is with a outlook message Item!
Erwin
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Thursday, March 17, 2005 6:23 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2003: Outlook not working using redemption
-DESPERATE
Hi all
2nd Posting
I have now wasted a total of 6 and a half hours on this It can't be that
difficult - surely
Can someone please help?
Code below modified from my previous post
I have references to Outlook 11
I have references to Redemption
All that side of things is OK
I can send up to 2 emails before the code chokes The email addresses are
real, they work
All I want this thing to do is
Create the message then send it - loop the recordset then Create the
message then send it - loop the recordset then...
Simple <sigh>
Many thanks
Darren
<Code>
Dim db As DAO.Database
Dim selSQL As String
Dim rs As DAO.Recordset
Dim gappOutlook As New Outlook.Application Dim omsg Dim msg
Set db = CurrentDb()
selSQL = "Select tmp_tblEmailAddresses.* from tmp_tblEmailAddresses" Set
rs = db.OpenRecordset(selSQL, dbOpenSnapshot)
Set omsg = gappOutlook.CreateItem(olMailItem)
Set msg = New Redemption.SafeMailItem
msg.Item = omsg
With rs
Do While Not .EOF
With msg
.To = rs!EmailAddress
.cc = Me.txtCC
.bcc = Me.txtBCC
.Subject = Me.txtSubject
.Attachments.Add Me.txtATTACH
.Body = Me.txtBody
'.Display ' shows it in the email client before
sending
.Send
End With
.MoveNext
Loop
End With
</Code>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com