this is the code i use to send emails:
Code
Sub Send_Email()
Dim OutApp As Object
Dim OutMail As Object
Dim cell As Range
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
On Error GoTo cleanup
For Each cell In Columns("J").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
Cells(cell.Row, "L").Value = "Value1" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = cell.Value
.cc = Cells(cell.Row, "P").Value
.BCC = Cells(cell.Row, "Q").Value
.Subject = "MySubject"
.Categories = "MyCategories"
.Importance = 2
.Body = "Message Body"
.Display 'Or use Display
End With
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub
Display More
how a text file can be to used as the body in this part? the text file will include the body of the email.
from .Body = "Message Body" to .Body = C:\body.txt ?
just how to link the code to that text inside the file to be included in the generated email? thanks!