title: Send Mail without password in C#
body: <p>I am working on one Asp.net application. I have one <strong>Email Reminder form</strong> in which my Client's Email ID &amp; checkbox is provided. Admin will select the checkbox &amp; press the <strong>send reminder</strong> button &amp; the mail will be sent to all the checked checkboxes i.e. to my clients.but in this form I have one Textbox say <strong>Sender</strong> in which Admin will put sender Email ID &amp; from that Email ID all the email will be sent to my clients. </p>
  
  <p>How can I send mail without password as admin can use any email ID from our company email IDs as per his requirement. How can I achieve this </p>
  
  <p>here is my code</p>
  
  <pre><code>SmtpClient smtpClient = new SmtpClient
                  {
                      Host = "smtp.office365.com",
                      Port = 25,
                      UseDefaultCredentials = true,
                      EnableSsl = true,
                      Credentials = new NetworkCredential("Adminsupport@abc.com", "123456")
                  };
                  var mailMessage = new MailMessage();
                  mailMessage.Subject = subject;
                  mailMessage.From = new MailAddress("Adminsupport@abc.com");
                  mailMessage.IsBodyHtml = true;
                  mailMessage.Body = body;
                      //"Email from : &lt;a href='mailto:" + from + "' target='_blank'&gt;" + from + "&lt;/a&gt;&lt;br/&gt;For Form Name : ";
                  mailMessage.To.Add(new MailAddress(tomail));
  
                  smtpClient.Send(mailMessage);
  
                  mailMessage.Dispose();
                  smtpClient.Dispose();
  </code></pre>