I have the below code to send out an email. How do I go about setting the From Account/Address?
Code:
Function funSendEmail(strEmailAddr As String, strBody As String, strHeader As String, strFooter As String, strSubject As String)
On Error GoTo ErrorHandler
Dim objOutlook As Outlook.Application
Dim objAccount As Outlook.Account
Dim objOutlookAttach As Outlook.Attachment
Dim OutApp As Object
Dim OutMail As Object
Dim strAddress As String
Set objOutlook = New Outlook.Application
Set OutMail = objOutlook.CreateItem(0)
OutMail.To = strEmailAddr
OutMail.Subject = strSubject
OutMail.HTMLBody = strHeader & strBody & strFooter
If gblDisplayEmail Then
OutMail.Display
Else
OutMail.Send 'Send | Display
End If
Set OutMail = Nothing
Exit Function
ErrorHandler:
MsgBox "Critical Error!" & vbCrLf & vbCrLf & Err.Description, vbCritical, "Error # " & Err.Number
End Function