Email from excel to outlook

SURYA2016

New Member
Joined
Jul 29, 2020
Messages
10
Office Version
  1. 2007
Platform
  1. Windows
i need to send by mail excel to outlook email bulk

in this format Body text like same in the image, but payment terms should be change each email different.

IF Possible pls share vba code

1602175440861.png
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Logit

Well-known Member
Joined
Aug 31, 2016
Messages
3,697
.
You will need to edit some of the code so it fits your specific layout of column data :

VBA Code:
Sub SendEmail()
    Dim OutlookApp As Object
    Dim MItem As Object
    Dim cell As Range
    Dim email_ As String
    Dim cc_ As String
    Dim subject_ As String
    Dim body_ As String

     'Create Outlook object
    Set OutlookApp = CreateObject("Outlook.Application")

     'Loop through the rows
    For Each cell In Columns("a").Cells.SpecialCells(xlCellTypeConstants)

        email_ = cell.Value
        subject_ = cell.Offset(0, 1).Value
        body_ = cell.Offset(0, 2).Value
        cc_ = cell.Offset(0, 3).Value

        'Create Mail Item and send it
        Set MItem = OutlookApp.CreateItem(0)
        With MItem
            .To = email_
            .CC = cc_
            .Subject = subject_
            .Body = body_
            If Not Cells(cell.Row, "E").Value = "" Then
                .Attachments.Add (Path & "\" & Cells(cell.Row, "E").Value)
            Else
            End If
                
            .Display
        End With
    Next
End Sub

Download example workbook : WORKS - Email Multiple Addresses.xlsm
 

Watch MrExcel Video

Forum statistics

Threads
1,112,816
Messages
5,542,660
Members
410,567
Latest member
SCraig123
Top