How to send a email from C#.net?
<p>I am working on framework 2.I want to send email through my portal.I visited many site.From that I able to understand this much.Here is my code.I have created page design.What is smtpserver.This code giving me error.</p>

<blockquote>
  <p>System.Web.HttpException: The server rejected the sender address</p>
</blockquote>

<pre><code>  MailMessage Msg = new MailMessage();
        // Sender e-mail address.
        Msg.From = txtFrom.Text;
        // Recipient e-mail address.
        Msg.To = txtTo.Text;
        Msg.Subject = txtSubject.Text;
        Msg.Body = txtBody.Text;
        // your remote SMTP server IP.
        SmtpMail.SmtpServer = "smtp.gmail.com";
        SmtpMail.Send(Msg);
        Msg = null;
</code></pre>
