我无法理解一个事实......我已经创建了一个发送电子邮件的表单,它运行得非常好。现在我已经扩展了一个带有扩展 html 的 ajax 控制工具包的文本框,当我收到电子邮件时,我没有看到所有代码......我举了一个例子。我已经发送了这个:
<table><tbody><tr><td rowspan="2"> </td><td><b>LA QUALITA' ALPITOUR</b></td></tr><tr><td> </td></tr></tbody></table>
在电子邮件中,我只看到加粗的文本...所有其他代码都已编写且可见...为什么?我希望我已经很好地解释了我的问题......我不是英语,我写得不是很好。
如果需要,这是我的代码隐藏:
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>");
}
这是我的 html/asp 代码:
<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 />
之前感谢您的回答!