Nola bidali mezu elektroniko bat Webpart tik Moss 2007

Hi Devs,
Jarraian kode zati Email bidaltzeko Webpart from da.

Sistema erabilita;
System.Collections.Generic erabiliz;
System.ComponentModel erabiliz;
System.Text erabiliz;
System.Web erabiliz;
System.Web.UI erabiliz;
System.Web.UI.WebControls erabiliz;
System.Collections.ObjectModel erabiliz;
Microsoft.SharePoint.Utilities erabiliz;
Microsoft.SharePoint erabiliz;
System.Data erabiliz;
System.Collections erabiliz;
namespace sendmail
{
Klase publiko sendmail : Microsoft.SharePoint.WebPartPages.WebPart
{
TextBox pribatua txtTo;
Button pribatua btnSendMail;
babestuta override void CreateChildControls()
{
txtTo = TextBox berria();
this.Controls.Add(txtTo);
btnSendMail = Button berria();
btnSendMail.Text = “Bidali posta elektroniko”;
btnSendMail.Click = EventHandler berria(SendMail_Click);
this.Controls.Add(btnSendMail);
}
void SendMail_Click(Objektu bidaltzen, EventArgs e)
{
SPSite _site = SPSite berria(HttpContext.Current.Request.Url.ToString());
_web SPWeb = _site.OpenWeb();
_web.AllowUnsafeUpdates = true;
SPUtility.SendEmail(_web, faltsua, faltsua, txtTo.Text, “Test-posta”, “Testu-gorputza Mezua”);
_web.Dispose();
_site.Dispose();
}
}
}

Sortu Webpart eta erregistratu SafeControl gisa

Iruzkin bat idatzi

Erabil dezakezu HTML tags horiek

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>