Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-04-2012, 05:04 AM
marreco marreco is offline Send emails to multiple people at once Windows XP Send emails to multiple people at once Office 2007
Novice
Send emails to multiple people at once
 
Join Date: Mar 2012
Posts: 8
marreco is on a distinguished road
Default Send emails to multiple people at once

HI.
Code:
Sub Send_EMail()

    Dim OutApp As Object
    Dim OutMail As Object
    Dim cell As Range

    Application.ScreenUpdating = False
    Set OutApp = CreateObject("Outlook.Application")

    On Error GoTo limpa

    For Each cell In Columns("H").Cells.SpecialCells(xlCellTypeConstants)
    'verifica se o email é valido e se o cliente possui o estados A (atrasado)
        If cell.Value Like "?*@?*.?*" And LCase(Cells(cell.Row, "I").Value) = "a" Then
            Set OutMail = OutApp.CreateItem(0)
            On Error Resume Next
            With OutMail
                .To = cell.Value
                .Subject = "Aviso"
                .Body = "Caro " & Cells(cell.Row, "B").Value _
                      & vbNewLine & vbNewLine & _
                        "Entre em contato com nosso serviço de cobrança " & _
                        "para tratar assunto de seu interesse com urgência"
                'Podemos enviar um anexo
                .Attachments.Add ("c:\dados\carta.txt")
                .Send
            End With
            On Error GoTo 0
            Set OutMail = Nothing
            MsgBox ("Email enviado com sucesso..." & " para " & Cells(cell.Row, "B").Value)
        End If
    Next cell
limpa:
    Set OutApp = Nothing
    Application.ScreenUpdating = True
    
End Sub
I'd like to send multiple emails simultaneously without the need to use Outlook, possibly be using the Microsoft CDO library, someone would know how it could be done from the routine posted above, or otherwise the same.
Reply With Quote
  #2  
Old 05-13-2012, 06:26 PM
marreco marreco is offline Send emails to multiple people at once Windows XP Send emails to multiple people at once Office 2007
Novice
Send emails to multiple people at once
 
Join Date: Mar 2012
Posts: 8
marreco is on a distinguished road
Default

Hi
Any idea?
Reply With Quote
  #3  
Old 05-13-2012, 06:38 PM
macropod's Avatar
macropod macropod is offline Send emails to multiple people at once Windows 7 64bit Send emails to multiple people at once Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See: http://www.rondebruin.nl/cdo.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Send emails to multiple people at once I want to send email to large number of people, with different addressing sanketmlad Outlook 1 10-06-2011 09:32 AM
Send emails to multiple people at once Send emails only during business hours sdavisoftv Outlook 2 09-14-2011 10:21 AM
Outlook 2010 cannot send emails through Cox navyveteran Outlook 0 03-14-2011 02:47 PM
Send emails to multiple people at once I want to know how I can send emails on my boss' behalf Jen Outlook 2 07-29-2010 03:35 PM
Can't send emails Sharon Garrett Outlook 0 12-14-2005 08:32 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:26 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft