[AccessD] e-mailing to all the people at the same time

MartyConnelly martyconnelly at shaw.ca
Thu Jan 8 00:23:25 CST 2004


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





More information about the AccessD mailing list