The macro is from Excel VBA...here is the code:
Sub sendemail()
Set aOutlook = CreateObject("Outlook.Application")
Workbooks.Open Filename:="C:\ideas\Name File.xls"
Set DataName = Application.ActiveWorkbook
Workbooks(DataName.Name).Worksheets(1).Activate
PathName = "I:\Jobs\"
For I = 1 To 2
FullPath = PathName & Cells(I, 1) & ".xls"
Set aEmail = aOutlook.CreateItem(olmailitem)
aEmail.Importance = olImportanceHigh
aEmail.Subject = "This is a test...this is only a test"
aEmail.Body = "I am testing out sending one attachment to multiple people. Please respond to me if you received 2 reports. Thanks."
If Trim(Cells(I, 2)) <> "" Then
aEmail.Recipients.Add Cells(I, 2)
End If
If Trim(Cells(I, 3)) <> "" Then
aEmail.Recipients.Add Cells(I, 3)
End If
If Trim(Cells(I, 4)) <> "" Then
aEmail.Recipients.Add Cells(I, 4)
End If
If Trim(Cells(I, 5)) <> "" Then
aEmail.Recipients.Add Cells(I, 5)
End If
Set myAttachments = aEmail.Attachments
myAttachments.Add FullPath
aEmail.Send
Next I
End Sub
The email sends just fine with the attachment it just sends it as HTML instead of Plain Text