This article shows you how to create a rule in Gmail that removes a message from your inbox and sends an email to the sender letting them know they've been blocked.
How to Stop Someone on Gmail from Emailing You
Instead of writing individual emails to the people who are sending you spam, use a template to send an automatic response when you block someone's email. Before you can use a template, however, you need to enable templates in Gmail.
Sign in to your Gmail inbox.
Select Settings (the gear icon).