Erwin Craps - IT Helps
Erwin.Craps at ithelps.be
Thu Jan 8 01:49:24 CST 2004
Please note that for security reasons it's better to put the recipients
(in case of mass mailing) in he BCC and not in the regular TO.
I'm using slightly another method than the code suggested by Marty, but
I supose you only need to change the
objOutlookRecip.Type = olTo line in smething like
objOutlookRecip.Type = olBcc
It's advisable to put your (an) own e-mail address in the to field.
Erwin
-----Oorspronkelijk bericht-----
Van: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] Namens MartyConnelly
Verzonden: donderdag 8 januari 2004 7:23
Aan: Access Developers discussion and problem solving
Onderwerp: Re: [AccessD] e-mailing to all the people at the same time
Well here is a starter email code using outlook, if you are using
outlook see methods of accessing an outlook contact list at
http://www.slipstick.com If you are using different mail method or
server, you will have to tell us.
Sub SendMessageTo(sEmailAddress As String, sMessageHdr As String,
sMessage
As String)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add(sEmailAddress)
' Set objOutlookRecip = .Recipients.Add(sEmailAddress1)
' Set objOutlookRecip = .Recipients.Add(sEmailAddress2)
objOutlookRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = sMessageHdr
.Body = sMessage
.Importance = olImportanceHigh 'High importance
' Resolve each Recipient's name.
For Each objOutlookRecip In .Recipients
objOutlookRecip.Resolve
Next
.Send
End With
Set objOutlook = Nothing
End Sub
Kostas Konstantinidis wrote:
>Hi all,
>Is it possible to send a common e-mail message at the same time, to
all the
>e-mail addresses which incloude into a field?
>The field design is "hyperling" and there I am keeping only e-mail
addresses
>
>Thank's a lot
>Kostas Konstantinidis
>
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>
>
--
Marty Connelly
Victoria, B.C.
Canada
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com