Q: How to stored Emails in SQL database and queried in an ASP.NET Application I'm creating a backup monitoring application that I am going to write in Visual Studio using ASP.NET. 
The way I would like this to work is backup emails being sent from the server that has a backup monitoring solution and are stored in a SQL database (SQL Server Express, MySQL) whatever would be best for something like this. I then plan to use this data to query and show statistics such as what servers have backed up successfully for each customer, and those that have failed. Also what servers have backed up successfully most and error trends such as not enough disk space etc. 
Would this be possible and if so could someone point me in the right direction wither I should start trying to get information into a database first and foremost and how to achieve that or should I start by creating the application such as login, dashboard etc. I haven't got a strong programming background we covered some Visual Basic and ASP.NET in university and I was hoping to learn a lot from this project. 
I was thinking of setting up a test environment with a server running a backup product and purposely making backups fail for testing and have access to the hardware/software resources working for an IT Consultancy / Support company. 
Thanks in advance!

A: After some searching I came across this website which has a great piece of code that reads emails from an inbox such as Gmail and stores them in an SQL database.
protected void SaveEmails(object sender, EventArgs e)
{
    for (int i = 0; i < this.Emails.Count; i++)
    {
        string constr = ConfigurationManager.ConnectionStrings["ConString2"].ConnectionString;
        string sqlStatment = "INSERT INTO [Emails] ([From],[Subject],[Body],[Date]) VALUES (@From ,@Subject,@Body,@Date)";
        using (SqlConnection con = new SqlConnection(constr))
        {
            using (SqlCommand cmd = new SqlCommand(sqlStatment, con))
            {
                con.Open();
                cmd.Parameters.AddWithValue("@From", this.Emails[i].From);
                cmd.Parameters.AddWithValue("@Subject", this.Emails[i].Subject);
                cmd.Parameters.AddWithValue("@Body", this.Emails[i].Body);
                cmd.Parameters.AddWithValue("@Date", this.Emails[i].DateSent);
                cmd.ExecuteNonQuery();
                con.Close();
            }
        }
    }
}


A: For the architecture of this you can try creating something like this: 
External systems: Will write to the sql database  
Database: Only needs one table. With possibly these columns (to give you an idea)


*

*Receiver

*Sender

*IsSent

*BodyMessage

*SentTime


Sender: A sender application/service that will query the database at regular intervals for unsent emails and send them.  
If you wonder how you technically query and insert into a SQL database then that's something there are plenty of resources on. 
