Send mail form exception : System.Runtime.InteropServices.COMException: ??? ?????? "SendUsing" ???? ?÷?
<p>Im trying to make an email form in my website (its a local host for now),
When I run my code, and press on "send", its throwing me this exception :</p>

<blockquote>
  <p>System.Runtime.InteropServices.COMException: ??? ?????? "SendUsing"
  ???? ?÷?.</p>
</blockquote>

<p>what could be the problem?</p>

<p>this is my code :</p>

<pre><code>&lt;%@ Import Namespace="System.Web.Mail" %&gt;

&lt;script language="c#" runat="server"&gt;
    protected void Button2_Click(object sender, EventArgs e)
    {
        MailMessage msg = new MailMessage();

        msg.To = "XXX@gmail.com";

        msg.From = EmailTxt.Text;

        msg.Subject = "Fun With Daniel Email: from" + UsernameTxt.Text;

        msg.Body = MessegeBox.Text;
        msg.BodyFormat = MailFormat.Text;
        ErrorMessege.Text = "Sending..";


        System.Web.Mail.SmtpMail.Send(msg);

        ErrorMessege.Text = "The Email Sent successfully!";



    }

&lt;/script&gt;

&lt;td&gt;
                                &lt;asp:TextBox ID="UsernameTxt" runat="server"&gt;&lt;/asp:TextBox&gt;
                                &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ErrorMessage="Please insert a Username"
                                    ControlToValidate="UsernameTxt" ForeColor="Red" Display="None" 
                                    SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                            &lt;td&gt;
                                Email
                            &lt;/td&gt;
                            &lt;td&gt;
                                &lt;asp:TextBox ID="EmailTxt" runat="server"&gt;&lt;/asp:TextBox&gt;
                                &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ErrorMessage="Please insert Password"
                                    ControlToValidate="EmailTxt" ForeColor="Red" Display="None" 
                                    SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                            &lt;td&gt;
                                Messege
                            &lt;/td&gt;
                            &lt;td&gt;
                                &lt;asp:TextBox ID="MessegeBox" runat="server" Height="100px" TextMode="MultiLine"&gt;&lt;/asp:TextBox&gt;
                                &lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="You have to write a messege"
                                    ControlToValidate="MessegeBox" ForeColor="Red" Display="None" 
                                    SetFocusOnError="True"&gt;&lt;/asp:RequiredFieldValidator&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                        &lt;tr&gt;
                            &lt;td&gt;
                                &lt;asp:Button ID="Button2" runat="server" Text="Login" OnClick="Button2_Click" /&gt;

                            &lt;/td&gt;
                            &lt;td&gt;

                                &lt;asp:Label ID="ErrorMessege" runat="server" ForeColor="Red"&gt;&lt;/asp:Label&gt;
                                &lt;asp:ValidationSummary ID="ValidationSummary2" runat="server" ForeColor="Red" /&gt;
                            &lt;/td&gt;

                        &lt;/tr&gt;
</code></pre>
