title: error sending email using ASP.NET web app
body: <p>I'm trying to send email to my site users (ASP.NET, VS2010), currently I'm using my gmail account for sending email, but I'm getting the following error:</p>
  
  <pre><code>ex = {"Failure sending mail."}
  InnerException = {"The remote name could not be resolved: 'smtp@gmail.com'"}
  </code></pre>
  
  <p>it is my code:</p>
  
  <pre><code>MailMessage mailObj = new MailMessage("mygmailaccount@gmail.com", "myyahooaccount@yahoo.com", "test", "test2");
              SmtpClient SMTPServer = new SmtpClient("smtp@gmail.com");
              SMTPServer.Credentials = new System.Net.NetworkCredential("mygmailaccount", mygmailpassword);
              try
              {
                  SMTPServer.Send(mailObj);
              }
              catch (Exception ex)
              {
                  string a = ex.Message;
              }
  </code></pre>
  
  <p>what is going wrong here? should I do something in my web.config? how can I find smtp server of my own host?</p>