public ActionResult SendQuickRegisterEmail(QuickRegisterEmail registerEmail)
        {
            if (ModelState.IsValid)
            {
                string emailSubject = WebConfigurationManager.AppSettings["RegisterEmailToSendSubject"];
                string emailTo = WebConfigurationManager.AppSettings["RegisterEmailToSendTo"];
                MailMessage mailMessage = new MailMessage();
                mailMessage.From = new MailAddress(registerEmail.EmailAddress);
                mailMessage.Subject = emailSubject;
                mailMessage.To.Add(emailTo);
                mailMessage.Body = EmailMessage(registerEmail);
                mailMessage.IsBodyHtml = true;

                if (registerEmail.Attachment != null)
                {
                    mailMessage.Attachments.Add(new Attachment(registerEmail.Attachment.InputStream, registerEmail.Attachment.FileName));
                }

                SmtpClient smtpClient = new SmtpClient();
                smtpClient.Send(mailMessage);

                return View("QuickRegisterEmailThankYou", registerEmail);
            }
            return View("Index");
        }
 private string EmailMessage(QuickRegisterEmail registerEmail)
 {
     StringBuilder sbMailMessage = new StringBuilder();
     sbMailMessage.AppendLine("<h2>EMI Europe Registration Form</h2>");
     sbMailMessage.AppendLine("Dear Sir|Madam,<br><br> " + registerEmail.Title + " " + registerEmail.FirstName + " " + registerEmail.LastName + " has an enquiry.<br><br>");
    
     sbMailMessage.AppendLine("<b>Telephone Number</b> :&nbsp; &nbsp;" + registerEmail.Telephone + ".<br>");
     sbMailMessage.AppendLine("<b>Email Address</b> : " + registerEmail.EmailAddress + ".<br>");
     sbMailMessage.AppendLine("<b>Profession</b> : " + registerEmail.Profession + ".<br>");
     sbMailMessage.AppendLine("<br>" + registerEmail.FirstName + " " + registerEmail.LastName + "</p>");
     return sbMailMessage.ToString();
 }