I can't get the signature onto the email and change the from account.
With this code the signature is inserted but it doesn't keep the formatting.
I tried another one that copied it from a Word document but it never worked.
Sub Send_Mails()
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("Sheet1")
Dim I As Integer
Dim OA As Object
Dim msg As Object
Dim OutAccount As Outlook.Account
Set OA = CreateObject("outlook.application")
Dim last_row As Integer
last_row = Application.CountA(sh.Range("A:A"))
Set msg = OA.CreateItem(0)
With msg
.Display
End With
Signature = msg.Body
For I = 2 To last_row
'msg.Display
msg.To = sh.Range("A" & I).Value
msg.cc = sh.Range("B" & I).Value
msg.Subject = sh.Range("C" & I).Value
msg.Body = sh.Range("D" & I).Value & Signature
If sh.Range("E" & I).Value <> "" Then
msg.attachments.Add sh.Range("E" & I).Value
End If
'msg.send
sh.Range("F" & I).Value = "Sent"
Next I
MsgBox "All the mails have been sent successfully"
End Sub