title: C# - Send e-mail without having to login to server
body: <p>I have an application that needs to send e-mails.  Currently, this is what I am using:</p>
  
  <pre><code>        System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage();
          MyMailMessage.From = new System.Net.Mail.MailAddress(fromemail.Text);
          MyMailMessage.To.Add(toemail.Text);
          MyMailMessage.Subject = subject.Text;
          MyMailMessage.Body = body.Text;
          System.Net.Mail.SmtpClient SMTPServer = new System.Net.Mail.SmtpClient("smtp.gmail.com");
          SMTPServer.Port = 587;
          SMTPServer.Credentials = new System.Net.NetworkCredential("email", "password");
          SMTPServer.EnableSsl = true;
          SMTPServer.Send(MyMailMessage);
  </code></pre>
  
  <p>Is there a simple way to send an e-mail without having to login to a server?  Thank you.</p>