3/18/2014

Send E-Mail ASP.Net C# Coding

You can send a mail from C# coding in the button click event.

Here i have considered gmail as the E-Mail Gateway you can choice your own gateway and give the gateways setting and port settings here.

var myMailMessage = new System.Net.Mail.MailMessage();
myMailMessage.From = new System.Net.Mail.MailAddress("serveremail@gmail.com"); myMailMessage.To.Add("****Recipient Mail ID*****"); 
myMailMessage.CC.Add("****Recipient CC Mail ID*****"); 
myMailMessage.Subject = "Your Subject";
myMailMessage.Body = "Welcome to our website"; 
var smtpServer = new System.Net.Mail.SmtpClient("smtp.gmail.com"); 
smtpServer.Port = 587; 
smtpServer.Credentials = new System.Net.NetworkCredential("Fromemailid here", "****password***"); smtpServer.EnableSsl = true; smtpServer.Send(myMailMessage);

E-Mail sending with the help of html format will be updated soon.

2 comments:

  1. Content marketing is the procedure for creating, executing and conveying the content and related resources that are expected to make, sustain and grow an organization's client base. Phases of the content marketing procedure include: technique; content advancement; resource improvement; and channel influence crosswise over outbound marketing, inbound marketing and deals ennoblement. You can use this essay writing service for completing your content easily.

    ReplyDelete
  2. I don't generally commentary on blogs but as I see this blog I completely motivated to make one praise that I understand that not enough for the significant context on your writing as one that could understand easily.

    online nursing degree program

    ReplyDelete