title: Sending Email With Attachment C#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2204698/send-email-with-attachment-from-winforms-app">Send email with attachment from WinForms app?</a>  </p>
  </blockquote>
  
  
  
  <p>Here is my script:</p>
  
  <pre><code>     var fromAddress = new MailAddress("myemail@gmail.com");
       var toAddress = new MailAddress("myemail@gmail.com");
       const string fromPassword = "mypassword";
       const string subject = "Subject";
       const string body = "Body";
  
         var smtp = new SmtpClient
         {
             Host = "smtp.gmail.com",
             Port = 587,
             EnableSsl = true,
             DeliveryMethod = SmtpDeliveryMethod.Network,
             UseDefaultCredentials = false,
             Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
         };
         using (var message = new MailMessage(fromAddress, toAddress)
                   {
                       Subject = subject,
                       Body = body,
                   })
  
         {
             smtp.Send(message);
         }
  </code></pre>
  
  <p>It works well, yet I am yet to come up with a way to add an attachment. Yes, I know this site has examples, but I cannot find one that will send an attachment</p>