Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8905743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:28:16+00:00 2026-06-15T02:28:16+00:00

Possible Duplicate: send html email via C# ASP.NET Can anyone provide me with sample

  • 0

Possible Duplicate:
send html email via C# ASP.NET

Can anyone provide me with sample code for sending email which contains body in html format? I am totally new to this concept and struggling to do so.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:28:17+00:00Added an answer on June 15, 2026 at 2:28 am

    Try this

        public void SendErrorMail(string commaSeparatedEmails, string errorDate, string pageName, string errorMessage, string errorSource, string errorInnerException, string errorData, string errorTarget, string errorStack)
        {
            try
            {
                MailMessage mail = new MailMessage();
                SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
                SmtpServer.Port = 587;
                SmtpServer.Credentials = new System.Net.NetworkCredential("yourgmailid@gmail.com", "yourPass");
                SmtpServer.EnableSsl = true;
                mail.From = new MailAddress("yourmail@gmail.com");
                mail.To.Add(functionToGetValueFromDB());
    
                mail.Bcc.Add("oyurbccmail@gmail.com");
                mail.Subject = "Error Details";
                string mailtable =
                    "<html><table style= 'width: 352px' id='Mail' runat='server'>" +
                                              "<tr><td style='width: 100px; height: 25px'>" +
                                                      "  </td>" +
                                                  "  <td style='width: 100px; height: 25px'>" +
                                                     "   </td> " +
                                              "  </tr>" +
                                               " <tr>" +
                                                 "   <td style='width: 100px; height: 25px'>" +
                                                       " Error Date</td> " +
                                                   " <td style='width: 100px; height: 25px'> " +
                                                      errorDate + "</td> " +
                                               " </tr> " +
                                               "  <tr>" +
                                                    "<td style='width: 100px; height: 25px'>" +
                                                       "Error Page </td>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      pageName + "</td>" +
                                               " </tr>" +
                                               "  <tr>" +
                                                    "<td style='width: 100px; height: 25px'>" +
                                                       "Error Message </td>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      errorMessage + "</td>" +
                                               " </tr>" +
                                               " <tr>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      " Error Source</td>" +
                                                  "  <td style='width: 100px; height: 25px'>" +
                                                      errorSource + "</td>" +
                                               " </tr>" +
    
                                                " <tr>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      " Error InnerException</td>" +
                                                  "  <td style='width: 100px; height: 25px'>" +
                                                      errorInnerException + "</td>" +
                                               " </tr>" +
    
                                                " <tr>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      " Error Data</td>" +
                                                  "  <td style='width: 100px; height: 25px'>" +
                                                      errorData + "</td>" +
                                               " </tr>" +
    
                                                " <tr>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      " Error Target</td>" +
                                                  "  <td style='width: 100px; height: 25px'>" +
                                                      errorTarget + "</td>" +
                                               " </tr>" +
    
                                                " <tr>" +
                                                   " <td style='width: 100px; height: 25px'>" +
                                                      " Error Stack  </td>" +
                                                  "  <td style='width: 100px; height: 25px'>" +
                                                      errorStack + "</td>" +
                                               " </tr>" +
    
                                                "<tr>" +
                                                   " <td style='width: 100px; height: 24px'>" +
                                                   " </td>" +
                                                    "<td style='width: 100px; height: 24px'>" +
                                                      "  </td>" +
                                               " </tr>" +
                                          "  </table></html>";
                mail.IsBodyHtml = true;
                mail.Body = mailtable;
                SmtpServer.Send(mail);
            }
            catch (Exception ex)
            {
            }
        }
    

    function To Get Value From DB

    public string functionToGetValueFromDB()
    {
     //your sp codes here
    
    
     return to_mail;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Sending HTML email from PHP I need to send an html mail
Possible Duplicate: Sending email in .NET through Gmail I am trying to send a
Possible Duplicate: SMS from web application Sample code to send Mail via php //
Possible Duplicate: Sending HTML email from PHP Using PHP to send an email. I
Possible Duplicate: Send email using System.Net.Mail through gmail. (C#) I am using this code
Possible Duplicate: Sending email in .NET through Gmail I don't know what is the
Possible Duplicate: Send and receive NSData via GameKit I have struct which consists of
Possible Duplicate: sms from our site I want to send SMS from my asp.net
Possible Duplicate: Need to Send Email from HTML pages Is there a way to
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.