Tweak Junk Email Reporting tool to default to particular email on send?

Not open for further replies.


Outlook version
Outlook 2019 64-bit
Email Account
I have the Junk Reporting tool installed on Outlook 2019 64-bit. It works fine via the registry hack to always send to Microsoft AND to SPAMCOP reporting. However, I'd rather have the tool SEND via my GMAIL account and not my default hosted account. (The hosted account usually flags the outbound reporting email as SPAM and rejects it.) Is there a way of doing this in post processing? IOW, the logic would be if TO: contains then SEND from my Gmail account. Or maybe there's a further registry hack to default the Junk Tool to a particular FROM address. (Microsoft doesn't really support the tool these days).
if you don't need to send to Microsoft and only want to send to spamcop, I have a macro here somewhere that will get the message header, add it to the message and send. It can set the from account before sending.

Ah, found it.
Thanks Diane. With some cut & paste and fooling around, I was able to make it work. Certainly a lot easier to report to SpamCop only. Note that the SPAM report macro does not have a way of setting the outbound email account for sending. So I cobbled this together. If you see an easier way to do it, let me know. I left the display vs send alone and took out the boilerplate note since SpamCop no likey that stuff.

Sub ForwardSpam()
      Dim olItem As Outlook.MailItem, olMsg As Outlook.MailItem
      Dim strHeader As String
      Dim strFWHeader As String
      Dim oAccount As Outlook.Account
      For Each olItem In Application.ActiveExplorer.Selection
          strHeader = GetInetHeaders(olItem)
          For Each oAccount In Application.Session.Accounts
              If oAccount = "<sending account name>" Then
              Set olMsg = olItem.Forward
              With olMsg
                  .To = "<SPAM reporting address>"
                  .BodyFormat = olFormatPlain
                  .Body = strHeader & vbCrLf & vbCrLf & olItem.Body
                  .SendUsingAccount = oAccount
              .Display ' change to .send when satisfied
         End With
         End If
      Set olMsg = Nothing
  End Sub
  Function GetInetHeaders(olkMsg As Outlook.MailItem) As String
      ' Purpose: Returns the internet headers of a message.'
      ' Written: 4/28/2009'
      ' Author:  BlueDevilFan'
      ' //
      ' Outlook: 2007'
      Dim olkPA As Outlook.PropertyAccessor
      Set olkPA = olkMsg.PropertyAccessor
      GetInetHeaders = olkPA.GetProperty(PR_TRANSPORT_MESSAGE_HEADERS)
      Set olkPA = Nothing
  End Function
It looks good.

This is correct to set the sending account -

For Each oAccount In Application.Session.Accounts
If oAccount = "<sending account name>" Then
Set olMsg = olItem.Forward
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
P Tweak vba so it can target another mailbox Outlook VBA and Custom Forms 1
Bri the Tech Guy Registry Tweak to make "Run a Script" Action Available Outlook VBA and Custom Forms 2
Kika Melo How to mark as Junk any message not from Contacts (in Using Outlook 3
J Why are my Junk options shown as slashed off Using Outlook 6
Jay Freedman Outlook forgets "not junk" marking Using Outlook 0
J How to Block junk/spam domain Using Outlook 0
CWM330 Outlook 365 Hey Diane! MS 365 Biz Standard and "Potential Spam" addressed to others coming to my JUNK folder? Using Outlook 2
P What is your strategy for dealing with SPAM and Junk Mail? Using Outlook 1
J how to stop junk emails from * ? Using Outlook 2
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
T Junk Email does not get added to the Blocked Sender List Using Outlook 0
F Junk Email does not get added to the Blocked Sender List Using Outlook 4
T How can you include Junk Email in Search Results like you can include Deleted Items? Using Outlook 3
Retired Geek Junk Folder Clean Up Rules Exchange Server Administration 1
I Junk Mail and PersonMetadata Using Outlook 2
F Outlook 2016 Junk E-Mails Using Outlook 5
J Junk mail doesn't work Using Outlook 3
T New Account Shows No Junk Mail Folfer Using Outlook 0
T Probem with junk mail folder in new account in Outlook Using Outlook 0
C Why can junk mail be from one’s own email address? Using Outlook 7
M junk mail folder Using Outlook 2
Diane Poremsky Junk Mail Filtering in Outlook Using Outlook 0
P Outlook 2010 sending safe senders email to junk box Using Outlook 8
K Emails stuck in 'Junk' folder Using Outlook 0
David Rahrer Change default Junk E-Mail folder Using Outlook 6
S - Junk files Using accounts in Outlook 1
R Not junk email Using Outlook 3
lotsbg Loads of junk in second email needs fixing Using Outlook 1
7 Macro to mark message as junk and delete Outlook VBA and Custom Forms 3
G filtering email with missing TLD to Junk Outlook VBA and Custom Forms 1
M trying to disable junk email filter. completely. Using Outlook 4
R Outlook - alternatives to Rules / Junk? Using Outlook 5
Z OL2007 - is there a way to disable the "feature" that cripples mails that are in the "junk" folder? Using Outlook 37
B How do I REALLY disable Outlook Junk E-mail sorting in OL2010 and/or 2013? Using Outlook 1
A After receiving the same email 3 times, Outlook starts sending it to junk Using Outlook 1
R Outlook 2007 junk mail Using Outlook 4
mrje1 Junk Options - Safe Lists not working. Using Outlook 0
C Outlook 2013 Junk Mail Filters Using Outlook 0
L My junk email folder has disappeared - Using Outlook 0
Commodore Junk Mail filtering and IMAP Using Outlook 3
D Junk Mail filter Using Outlook 1
V Clicking box to delete junk mail doesn't stay Using Outlook 2
V Macro to view Junk Email folder Using Outlook 4
J Junk email Exchange Server Administration 1
V Emails going to Junk folder Using Outlook 2
A Junk mail Using Outlook 4
H Two accounts, Junk email filter only works on one account, office 2010, pop3 Using Outlook 5
U Problems with junk mail folder... Using Outlook 1
R Emails suddenly going to the Junk email folder Exchange Server Administration 3
C starting Outlook 2003 sp3 sets Junk Email setting to 'No automatic filtering' Using Outlook 3

Similar threads