How to send email from Outlook automatically from specific account. Watch the training video below:
There will be times when we wish to send an email to different people through different email accounts. We can automate this process for sending email to different persons using specific accounts in Outlook via Excel. The code below explains the complete automation in detail:
Dim SendTo As String
Dim Cell As Range
For Each Cell In Range("A2", Range("A" & Cells.Rows.Count).End(xlUp)) 'We create a blank mail With CreateObject("Outlook.Application").CreateItem(0) SendTo = Trim(Cell.Value) ' We use the properties of the mail If SendTo <> "" Then .To = SendTo .Subject = Cell.Offset(0, 1).Value .Body = Cell.Offset(0, 2).Value 'We now use the specific sender from our worksheet Set .SendUsingAccount = .Session.Accounts.Item(Cell.Offset(0, 3).Value) ' .Send .Display End If End With Next
Note: Some lines of code have been ‘remarked’ out. You can also use ‘CC’ and ‘BCC’ to send emails to multiple persons.
You can also download a sample file for practice from the link below: