humerick
asked on
How to automatically change my “FROM” when sending certain emails
We have a program at work that about 15 of us use. It is basically a testing/scoring software. Once we are done scoring, the program creates an email to the employee that we just scored. This email is created automatically from our own personal Outlook (2010) on our desktops. The FROM field obviously defaults to me, and I need it to be anonymous. I know that I can go in and change it manually each time I send the email, but I would like to know if there is a way to have these particular emails default to our generic email account which I have access to? I do not have any access to the source code of the program that generates the email. The subject will always be the same for these emails. Can I use that fact to have the FROM field change without me having to do it each time? Thank you in advance for any help on this.
Not sure if this will work, but try putting this in macro
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error GoTo ErrorHandler
Dim oAccount As Outlook.Account
For Each Account In Application.Session.Accounts
If Account.DisplayName = "yourCommonEmail" Then
oAccount = Account
End If
Next
With Item
.SendUsingAccount = oAccount
End With
Exit Sub
ErrorHandler:
End Sub
Najam UddinWhile the logic behind the script is pretty much solid, it's still not Automatic.
Expert Comment 2015-11-04 at 23:27:54ID: 41189266
Not sure if this will work, but try putting this in macro
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) On Error GoTo ErrorHandler Dim oAccount As Outlook.Account For Each Account In Application.Session.Accounts If Account.DisplayName = "yourCommonEmail" Then oAccount = Account End If Next With Item .SendUsingAccount = oAccount End With Exit Sub ErrorHandler: End Sub
Granted, it will change the sender address, but in my humble opinion running the script is basically the same as manually changing the address
Why he need to run this manually, when you can create macro, that will fire on send event.
Najam Uddin
Expert Comment 2015-11-04 at 23:34:17ID: 41189284
Why he need to run this manually, when you can create macro, that will fire on send event.
Such a bind would cause ALL of his mails to be sent from the generic e-mail account - he needs a rule to check for the subject.
I appreciate your concern, Well in that case we can help him by getting more detail about subject line and update logic. I posted it as a possible to getting it done without needing source code.
That is indeed a way to get it automated. I'm confident the subject can be used to set up a rule for triggering VBA code. The only issue I see is that you need to trust that rule, as you have no way to check the function before you send the mail. (Because the rule can trigger only on send or receive.)
ASKER
The subject line will always read as, "Call Score Report" if that helps.
well then, the rule should search for topics containing "Call Score Report".
but we might want to add an exception if it contains "RE" or "FW".
but we might want to add an exception if it contains "RE" or "FW".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Other than that I see no automatic solution for you I'm afraid.