How to send html email from C#
The System.Net classes provide the functionalities that is similar to Microsoft WinInet API . Here we are using System.Net class for sending an HTML email from the following C# program . In an HTML email , the body part contain HTML codes like HTML pages. In the previous C# program SMTP email from C# describes how to send an email with a text body . Here instead of text body part we are sending email with HTML body part.
mail.IsBodyHtml = true; string htmlBody = "create html page" ; mail.Body = htmlBody;
The following C# source code shows how to send an email with HTML body part from a Gmail address . The Gmail SMTP server name is smtp.gmail.com and the port using for send mail is 587 . Here using NetworkCredential for password based authentication.
SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");
You have to provide the necessary information like your gmail username and password etc.
- How to send email from C#
- How to send email with attachment from C#
- How to send cdo email from C#
- How to find hostname of a computer
- How to find IP Adress of a computer
- How to read URL Content from webserver
- How to C# Socket programming
- C# Server Socket program
- C# Client Socket program
- C# Multi threaded socket programming
- C# Multi threaded Server Socket programming
- C# Multi threaded Client Socket programming
- How to C# Chat server programming
- How to C# Chat Server
- How to C# Chat Client
- How to web browser in C#