title: How do I send an email message from my C# application?
body: <p>This is the code I wrote:</p>
  
  <pre><code>        MailMessage mail = new MailMessage("test@gmail.com", "me@myurl.com");
  
          mail.Subject = "This is a test!!";
          mail.Body = "testing...";
  
          SmtpPermission connectAccess = new SmtpPermission(SmtpAccess.Connect);
          System.Console.WriteLine("Access?  " + connectAccess.Access);
  
          SmtpClient client = new SmtpClient("mail.myurl.com", 2525);
          client.Send(mail);
  </code></pre>
  
  <p>It's not working.  I get an exception at the line "client.Send(mail)" that says "Mailbox unavailable.  The server response was (MYLOCALCOMPUTERNAME) [MY LOCAL IP]:3045 is currently not permitted to relay through."</p>
  
  <p>connectAccess.Access does return "Connect"  (I'm not sure if this was necessary... I added it in to start the troubleshooting process.)</p>
  
  <p>Does this mean that my local machine has to be configured in some way?  What about when I deploy my app to other peoples machines?  Will there need to be local configuration there?  I'm just looking to create a "Send Feedback" type of link from my application.</p>
  
  <p>(Note:  in my real application I am using my real email addresses in both the "to" and "from" and my smtp is really my smtp address at the place that hosts my url/website)</p>
  
  <p>thanks!</p>
  
  <p>-Adeena</p>