Sei sulla pagina 1di 1

zxzasd

By: amit1
kjlkj
090980
Abstract
asdasd asedsad sadsad sad asdasd
Matter
Pseudo Code for Sending Emails to the Users
Input: Sending Email Address. Receiving
Email Address, Subject, Message Output:
Message sent to the particular Email address
Namespaces to be used: System.Net.Mail
System.Net System.IO /*In the coming
section, the developer is using four variables
namely from, to, sub, msg. The from variable
is denoting the sending address, to variable is
denoting the receiving address, sub is the
subject of the mail and msg is the body of the
mail*/ sendMail ( ) //Start of sendMail
Procedure { // Creation of the object of
MailMessage class. It is a predefined class in
.Net framework. MailMessage mesg = new
MailMessage(); // Assigning the sending
address to a variable. from =
"apiit.crp@gmail.com"; // Assigning
the sending address variable to the variable of
MailMessage class mesg.From = new
MailAddress(from); mesg.To.Add(new
MailAddress(to)); //Assigning the receiving
address mesg.Subject = sub; //Allocating the
subject mesg.Body = msg; //Writing the body
of the message /* Passing the sending email
address and its password to the constructor of
System.Net.NetworkCredential class */
System.Net.NetworkCredential
mailAuthentication
=
new
System.Net.NetworkCredential("apiit.crp
@ g m a i l . c o m & q u o t ; ,
"campus123456789"); /* Invoking
the server and port number of gmail. There
are other port numbers also but the developer
is using this particular port number*/

SmtpClient
smtp
=
new
SmtpClient("smtp.gmail.com",
587); smtp.EnableSsl = true; // Enabling the
s e c u r i t y
s o c k e t
l a y e r
smtp.UseDefaultCredentials = false;
smtp.Credentials = mailAuthentication;
//Assigning the mailAuthentication object
smtp.Send(mesg); // Finally passing the
message } //End of sendMail Procedure
Coding Techniques Used:- #region lets you
specify a block of code that you can expand or
collapse when using the outlining feature of
the Visual Studio Code Editor.

Potrebbero piacerti anche