sending email using c#
C#
using System;
using System.Windows.Forms;
using System.Net.Mail;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("[email protected]");
mail.To.Add("to_address");
mail.Subject = "Test Mail";
mail.Body = "This is for testing SMTP mail from GMAIL";
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("username", "password");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
MessageBox.Show("mail Send");
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
}
Also in C#:
- Title
- vector between two points unity
- Category
- C#
- Title
- C# check if is first run
- Category
- C#
- Title
- c# how to exit program
- Category
- C#
- Title
- c# authorize attribute
- Category
- C#
- Title
- unity rotate around axis
- Category
- C#
- Title
- C# extend array
- Category
- C#
- Title
- what type of variable is true or false in c#
- Category
- C#
- Title
- c# arraylist contains
- Category
- C#
- Title
- c# convert Unix time in seconds to datetime
- Category
- C#
- Title
- c# keyvaluepair
- Category
- C#
- Title
- c# image to byte array
- Category
- C#
- Title
- c# arrays of arrays
- Category
- C#
- Title
- what is a protected int c#
- Category
- C#
- Title
- and unity
- Category
- C#
- Title
- unity clamp rotation
- Category
- C#
- Title
- how do i foreach c#
- Category
- C#
- Title
- c# check if type implements interface
- Category
- C#
- Title
- unity detect any key
- Category
- C#
- Title
- c# creating a data recovery software
- Category
- C#
- Title
- replace all ponctuation characters c#
- Category
- C#
- Title
- how to get the last element in an array in c#
- Category
- C#
- Title
- downlaod file and use C#
- Category
- C#
- Title
- unity cast float to int
- Category
- C#
- Title
- Assets/Scripts/Snake.cs(187,10): error CS0029: Cannot implicitly convert type `UnityEngine.Vector2Int' to `System.Collections.Generic.List<UnityEngine.Vector2Int>'
- Category
- C#
- Title
- C# Into To Tring Debug.Log
- Category
- C#
- Title
- No context type was found in the assembly
- Category
- C#
- Title
- c# foreach namevaluecollection
- Category
- C#
- Title
- razor preview
- Category
- C#
- Title
- loop gridcontrol devexpress c#
- Category
- C#
- Title
- how to detected WindowCloseEvent in other window wpf
- Category
- C#
- Title
- unity instantiate
- Category
- C#
- Title
- access object property C#
- Category
- C#
- Title
- how to convert float to int c#
- Category
- C#
- Title
- native-googlesignin configuration is null!?
- Category
- C#
- Title
- CS0103 C# The name 'Request.Url.Scheme' does not exist in the current context
- Category
- C#
- Title
- .sh script: check if file exist
- Category
- C#
- Title
- unity gameobject.find
- Category
- C#
- Title
- .net core executenonqueryasync transaction
- Category
- C#
- Title
- webutility.urlencode space
- Category
- C#
- Title
- unity hide mouse
- Category
- C#
- Title
- unity get list length
- Category
- C#
- Title
- csharp first element of array
- Category
- C#
- Title
- c# loop through two dimensional array
- Category
- C#
- Title
- loop through string array c#
- Category
- C#
- Title
- c# get list of all class fields
- Category
- C#
- Title
- Unity3d GPS code
- Category
- C#
- Title
- c# fold list
- Category
- C#
- Title
- winforms timer c#
- Category
- C#
- Title
- unity set sprite transparency
- Category
- C#
- Title
- unity if gameobject exists
- Category
- C#
- Title
- C# get all child classes of a class
- Category
- C#
- Title
- c# skip following code in loop
- Category
- C#
- Title
- abstract class c#
- Category
- C#
- Title
- autofixture ignore property
- Category
- C#
- Title
- print content of array c#
- Category
- C#
- Title
- c# delegate return value invoke
- Category
- C#
- Title
- text variable type unity
- Category
- C#
- Title
- unity c# set gameobject active
- Category
- C#
- Title
- c# summary tag
- Category
- C#
- Title
- c# stop loop in method
- Category
- C#
- Title
- c# multiline comment
- Category
- C#
- Title
- get number of sundays in a month c#
- Category
- C#
- Title
- c# System.Resources.MissingManifestResourceException error
- Category
- C#
- Title
- mvc c# w3schools
- Category
- C#
- Title
- wpf binding object get value
- Category
- C#
- Title
- how to declare 2d array in c#
- Category
- C#
- Title
- remove items from list c# condition
- Category
- C#
- Title
- go right unity
- Category
- C#
- Title
- iteration c#
- Category
- C#
- Title
- Read csv file into wpf C#
- Category
- C#
- Title
- c# index in select
- Category
- C#
- Title
- c# round number down
- Category
- C#
- Title
- unity assign button onclick
- Category
- C#
- Title
- using serial port in c#
- Category
- C#
- Title
- for each property in object c#
- Category
- C#
- Title
- mvc write to console
- Category
- C#
- Title
- how to sort string array alphabetically in c#
- Category
- C#
- Title
- why is c# say ; expected
- Category
- C#
- Title
- c# shorten an definition
- Category
- C#
- Title
- open tcp socket c#
- Category
- C#
- Title
- HashSet C# append
- Category
- C#
- Title
- how to convert a number to 2 decimal places in c#
- Category
- C#
- Title
- strtorime online
- Category
- C#
- Title
- how to update modal class using dbfirst in asp.net core
- Category
- C#
- Title
- The type or namespace name 'Scrollbar' could not be found
- Category
- C#
- Title
- c# get executable path
- Category
- C#
- Title
- git checkout reset hard
- Category
- C#
- Title
- block wapalyzer from detecting codeigniter
- Category
- C#
- Title
- how to randomly rotate rigidbody of object in unity
- Category
- C#
- Title
- how to track a branch on github
- Category
- C#
- Title
- unity variable from another script
- Category
- C#
- Title
- loop over enum values
- Category
- C#
- Title
- textblock line break
- Category
- C#
- Title
- c# get foreground window
- Category
- C#
- Title
- message authorization has been denied for this request. fiddler
- Category
- C#
- Title
- asp.net core mvc not triggering client side validation
- Category
- C#
- Title
- c# string to byte array
- Category
- C#
- Title
- c# exit for
- Category
- C#
- Title
- get query string parameter from string value c#
- Category
- C#
- Title
- change canvas color uwp c#
- Category
- C#