View Single Post
  #3   Report Post  
topola
 
Posts: n/a
Default Sending multiple EMails thru excel?

I think there is hope for your baseball league. Try using this macro
procedu

Sub Mail_workbook()
Dim Uzytkownik, Adresy As String
Dim i As Integer
Uzytkownik = Application.UserName
Range("a1", ActiveCell.SpecialCells(xlLastCell)).Select
i = 0

For Each cell In Selection
If InStr(cell, "@") 0 Then
ActiveWorkbook.SendMail cell.Text, "Topic Title"
Debug.Print cell.Text
If i = 0 Then
Adresy = cell.Text
Else
Adresy = Adresy & ", " & cell.Text
End If
i = i + 1
End If
Next

' ActiveWorkbook.SendMail Adresy, "Topic Title"
' This command in case you'd like to sent one group e-mail
' but breaks when there is wrong address within

MsgBox Uzytkownik & Chr(10) & Chr(10) & _
"Number of sent messages: " & i & Chr(10) & Chr(10) & _
"Addresses a " & Adresy
End Sub
---
Tomek Polak, http://vba.blog.onet.pl