Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019

Status
Not open for further replies.

Witzker

Senior Member
OS Version(s)
  1. iOS
Outlook version
Outlook 2019 32-bit
Email Account
Exchange Server 2007
Hi

I have to move from OL 2010 to 2019
Now its also time to take care of increasing Spam I get.

As OL can normally only add the whole email address to blacklist it would be great to have a macro in the ribbon that does the sane as
Block sender, but not only move xxx@dmain.xx but @domain.xx instead.

Maybe there is something still existing, what can be changed that way?

Pls help

regards
Witzker
 
But you can always go in and edit the blocked list to remove the alias.

OK but I think I did something wrong with my websites, so I'm drowning in Spam.
I need to do it with a macro otherwise it will take too much time.

THX for taking care!
 
Therefore, I need help with the macro

How to Get the domain of an email in Blacklist as described above
 
I'll need to look at it, I'm not sure what is exposed in the object model. But you can always go in and edit the blocked list to remove the alias

Any news?

More explanation of the Problem:

I get Spam mails in Inbox.
Then right-click on the mail
1606165007697.png

Absender sperren = Block Sender

This mail address should Go to Blacklist!?
1606165389283.png


1606165604843.png



I now look for a macro (BlcklistDomain)that inserts only the domain in this list
@grollmus.com
That all mails from the same Domain are blocked!!

This exists other way round with whitelist

1606165927106.png

Domain des Absenders nie sperren = never block this domain

1606165805641.png


Conlusion

When in Inbox standing on a Mail and clicking the desired macro(BlacklistDomain) the domain of this mail is put in blacklist.
I hope you understand what i mean.
 
You need to use Redemption.
Strings object (dimastr.com)


This sample saves the domain of the selected message to the safe list - you won't see it in the junk email list until you restart outlook though.

Code:
Sub writetojunk()

 Dim objApp As Outlook.Application
 Dim objMail As MailItem
 Dim strDomain As String
 
 Set objApp = Application
 Set objMail = objApp.ActiveExplorer.Selection.Item(1)
   strDomain = Right(objMail.SenderEmailAddress, Len(objMail.SenderEmailAddress) - InStr(objMail.SenderEmailAddress, "@") + 1)
  Debug.Print strDomain

 Set rSession = CreateObject("Redemption.RDOSession")
  rSession.MAPIOBJECT = Application.Session.MAPIOBJECT
  Set JunkOptions = rSession.JunkEmailOptions
  JunkOptions.TrustedSenders.Add strDomain
  JunkOptions.Save

MsgBox strDomain & " added to Safe list"

End Sub
 
selected message to the safe list
THX
I think I posted the wrong picture!! Sorry!
When in Inbox standing on a Mail and clicking the desired macro(BlacklistDomain) the domain of this mail is put in blacklist.

PLS. I want to add the senders' domain to
Blacklist!
1606529731054.png


And put the mail in Junk Folder

can you assist pls.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
N Line to move origEmail to subfolder within a reply macro Outlook VBA and Custom Forms 0
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
Eike Move mails via macro triggered by the click of a button? Outlook VBA and Custom Forms 0
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
B Macro to manually move selected emails to network folder Outlook VBA and Custom Forms 1
G email returns after running macro to move emails Outlook VBA and Custom Forms 1
Douglas Littlefield Macro to move E-mail Outlook VBA and Custom Forms 10
S Macro to print & move selected emails? Using Outlook 3
Douglas Littlefield Macro to move mail from inbox to Managed Folder Exchange Server Administration 1
L Macro Move E-mail attachments to a PC Folder Using Outlook 16
G Macro to move sent items from local folder to IMAP folder Using Outlook 4
S Outlook macro to move replied / forwarded emails to a seperate folder Using Outlook 1
C Help with a Macro to move emails to a different PST data file Using Outlook 4
J Macro to move mail from Inbox if older than 4 days Using Outlook 4
J Outlook macro to run before email is being send Outlook VBA and Custom Forms 0
H Macro to Delete Duplicate items in Outlook calendar where title is the same and date is the same Outlook VBA and Custom Forms 0
X Custom icon (not from Office 365) for a macro in Outlook Outlook VBA and Custom Forms 1
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
mrrobski68 Issue with Find messages in a conversation macro Outlook VBA and Custom Forms 1
G Creating Macro to scrape emails from calendar invite body Outlook VBA and Custom Forms 6
M Use Macro to change account settings Outlook VBA and Custom Forms 0
J Macro to Reply to Emails w/ Template Outlook VBA and Custom Forms 3
C Outlook - Macro to block senders domain - Macro Fix Outlook VBA and Custom Forms 1
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 0
S macro error 4605 Outlook VBA and Custom Forms 0
A Macro Mail Alert Using Outlook 4
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
J Macro to send email as alias Outlook VBA and Custom Forms 0
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 6
D Outlook 2016 Creating an outlook Macro to select and approve Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to check Cursor & Focus position Outlook VBA and Custom Forms 8
V Macro to mark email with a Category Outlook VBA and Custom Forms 4
M Outlook 2019 Macro not working Outlook VBA and Custom Forms 0
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 1
D Auto Remove [EXTERNAL] from subject - Issue with Macro Using Outlook 21
V Macro to count flagged messages? Using Outlook 2
sophievldn Looking for a macro that moves completed items from subfolders to other subfolder Outlook VBA and Custom Forms 7
S Outlook Macro for [Date][Subject] Using Outlook 1
E Outlook - Macro - send list of Tasks which are not finished Outlook VBA and Custom Forms 3
E Macro to block senders domain Outlook VBA and Custom Forms 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
Witzker Outlook 2019 Macro to answer a mail with attachments Outlook VBA and Custom Forms 2
A Outlook 2016 Macro to Reply, ReplyAll, or Forward(but with composing new email) Outlook VBA and Custom Forms 0
J Macro to Insert a Calendar Outlook VBA and Custom Forms 8
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6

Similar threads

Back
Top