This document provides code to send an email with C# by creating a MailMessage object with the from, to, subject, and body properties set. It then creates a SmtpClient, sets the credentials using a NetworkCredential with the gmail username and password, enables SSL, and sends the message. The code is contained within a Windows Forms project and button click handler to trigger the email send.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
52 views1 page
How To Send An Email With C
This document provides code to send an email with C# by creating a MailMessage object with the from, to, subject, and body properties set. It then creates a SmtpClient, sets the credentials using a NetworkCredential with the gmail username and password, enables SSL, and sends the message. The code is contained within a Windows Forms project and button click handler to trigger the email send.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
How To send an email with C#
Project Source Code :
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.Net.Mail;
namespace email { public partial class Form1 : Form {