ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 All rights reserved.Get gmail Name instead of EmailID using C# in ASP.Net<p>Please check Below Code for your reference. We sets display name for sender from where we sends an email. </p> <pre class="brush: csharp">protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.SendEmail(&#34;;, &#34;Email Subject&#34;, &#34;Your Email Body&#34;, &#34;Your Display Name&#34;); } } public void SendEmail(string fromEmailAddress, string subject, string body, string displayName) { using (MailMessage mm = new MailMessage()) { // To set Email Id Which user has entered also if Display name is there the pass it as second parameter when assigning mm.From in new MailAddress. // You can set sender&#39;s display name mm.From = new MailAddress(fromEmailAddress, displayName); // It is receiver email Id which we assign in mm.To. mm.To.Add(new MailAddress(&#34;;)); // Subject which you sets from Email mm.Subject = subject; // Body which Sets for Email mm.Body = body; mm.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); // Your Account details which you are going to Send Email from Application smtp.Host = &#34;;; smtp.EnableSsl = true; System.Net.NetworkCredential networkCred = new System.Net.NetworkCredential(); networkCred.UserName = fromEmailAddress; networkCred.Password = &#34;your gmail password&#34;; smtp.UseDefaultCredentials = true; smtp.Credentials = networkCred; smtp.Port = 587; smtp.Send(mm); } }</pre> <p>&nbsp;</p>, 14 Sep 2016 23:40:11 GMTGet gmail Name instead of EmailID using C# in ASP.Net<p>Thanks a lot Kalpesh sir for your prompt &nbsp;reply.</p>, 16 Sep 2016 00:17:33 GMTGet gmail Name instead of EmailID using C# in ASP.NetInstead of saying thanks mark the reply or replies(if multiple) that helped as Answer., 16 Sep 2016 03:13:27 GMT