Hi everyone,
I have been using excel to send outlook mail. Now working from outlook default to my personal outlook instead of the work outlook. I will like to modify my code to clearly state the sender in the code
I have been using excel to send outlook mail. Now working from outlook default to my personal outlook instead of the work outlook. I will like to modify my code to clearly state the sender in the code
VBA Code:
Sub SendMail()
Dim OApp As Object, EmailMail As Object
Set OApp = CreateObject("Outlook.Application")
Set EmailMail = OApp.createitem(0)
……..
…..
With EmailMail
‘.From = someone@example.com - I will like to explicitly state the sender by either check for the sender property and if it is [EMAIL]Someone@example.com[/EMAIL] then continue otherwise show a messenger "Using wrong or personal email"
.To = Recipient
'.Send
End With
Set EmailMail = Nothing
Set OApp = Nothing
End Sub