I can't understand a fact... I've created a form to send email and it goes really well. Now i've extended a textbox with an extended html of ajax control toolkit and, when I receive the email, I don't see all the code... i make an example. I've sent this:
<table><tbody><tr><td rowspan="2"> </td><td><b>LA QUALITA' ALPITOUR</b></td></tr><tr><td> </td></tr></tbody></table>
and in the email i see only the text bolded... all the other code is written and visible... why? I hope I've explained my problem well... I'm not english and I don't write it very well.
if it is needed, this is my code-behind:
protected void Btn_SendMail_Click(object sender, EventArgs e)
{
MailMessage msg = new MailMessage();
msg.From = new MailAddress("danieleluciani92@gmail.com");
msg.To.Add("danieleluciani92@gmail.com");
msg.Subject = txtSubject.Text;
msg.IsBodyHtml = true;
msg.Body = txtBody.Text;
SmtpClient sc = new SmtpClient("smtp.gmail.com");
sc.Port = 25;
sc.Credentials = new NetworkCredential("danieleluciani92@gmail.com", "Dead2006!");
sc.EnableSsl = true;
sc.Send(msg);
Response.Write("<script>alert('ennamo');</script>");
}
and this is my html/asp code:
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<span class="fontS">A:
<asp:TextBox ID="txtTo" runat="server" Font-Size="X-Small" ReadOnly="True">Tutti Gli Utenti</asp:TextBox>
<br />
Oggetto:
<asp:TextBox ID="txtSubject" runat="server" Font-Size="X-Small" /><br />
<asp:ScriptManager ID="ScriptManager1" runat="server" />
</span>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<span class="fontS">Tipo di Email:</span><asp:DropDownList ID="DropDownList1" runat="server" Font-Size="X-Small" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem Selected="True">Testo Libero</asp:ListItem>
<asp:ListItem>Email Con Offerte</asp:ListItem>
</asp:DropDownList>
<br />
<asp:CheckBoxList ID="CheckBoxList1" runat="server" Visible="False" AutoPostBack="True" OnSelectedIndexChanged="CheckBoxList1_SelectedIndexChanged">
</asp:CheckBoxList>
<br />
<asp:TextBox ID="txtBody" runat="server" Height="550px" TextMode="MultiLine" Width="900px" />
<asp:HtmlEditorExtender ID="txtBody_HtmlEditorExtender" runat="server" TargetControlID="txtBody" EnableSanitization="False">
</asp:HtmlEditorExtender>
</ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:Button ID="Btn_SendMail" runat="server" OnClick="Btn_SendMail_Click" Text="Invia" /><br />
Thanks before for your answers!