This is easily been done by windows application called windows form using
c#
You can use richtextbox to get the user email message.
Evaluate button to chec for the spam messages
If spam exists then you can call for pop up using MessageBox in forms control.
Output will be like


code will be like
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace spamMessageForms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string[] spamWords = { “offer”,”free”,”offer” };
int[] keyWordHit = new int[3];
string text;
private void button1_Click(object sender, EventArgs e)
{
string[] arr = (richTextBox1.Text).Split(‘ ‘);
for(int i=0;i<3;i++)
{
for(int j=0;j<arr.Length;j++)
{
if(spamWords[i]==arr[j])
{
keyWordHit[i]++;
MessageBox.Show(“spam”);
}
}
}
for(int i=0;i<spamWords.Length;i++)
{
text += spamWords[i] + ” ” + keyWordHit[i]+”n”;
}
MessageBox.Show(“Key word hit”+”n” + text);
}
}
}
Designer code:
namespace spamMessageForms
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name=”disposing”>true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support – do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button1 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(46, 60);
this.label1.Name = “label1”;
this.label1.Size = new System.Drawing.Size(151, 13);
this.label1.TabIndex = 0;
this.label1.Text = “Enter your email message here”;
//
// richTextBox1
//
this.richTextBox1.Location = new System.Drawing.Point(49, 108);
this.richTextBox1.Name = “richTextBox1”;
this.richTextBox1.Size = new System.Drawing.Size(256, 136);
this.richTextBox1.TabIndex = 1;
this.richTextBox1.Text = “”;
//
// button1
//
this.button1.Location = new System.Drawing.Point(81, 291);
this.button1.Name = “button1”;
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = “Evaluate”;
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(513, 393);
this.Controls.Add(this.button1);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.label1);
this.Name = “Form1”;
this.Text = “Form1”;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button1;
}
}
Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.