maybe
Sub Button1_Click()
Dim ce As Range, i As Long
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strbody As String
c01 = "c:\users\mark\desktop\dgr.txt" 'change the path and the file name
For i = 2 To Sheets("Sheet1").Range("a65536").End(xlUp).Row
If Cells(i, 1).Value <> "" Then
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
With Sheets("Sheet1")
strto = .Cells(i, 4).Value 'column d
strcc = .Cells(i, 5).Value
strbcc = ""
strsub = "Welcome to the Project " & " " & .Cells(i, 2)
strbody = "Hi there," & vbCrLf & "We welcome you all to the project" & " " & .Cells(i, 2).Value & " " & _
"whatever...." & _
vbCrLf & vbCrLf & "Thank you."
End With
With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strbody
.attachments.Add c01
'.Send
.display
Cells(i, 1).Select
With Selection.Font
.Color = -16776961
.TintAndShade = 0
End With
End With
Set OutMail = Nothing
Set OutApp = Nothing
End If
Next i
End Sub
Bookmarks