string sTo = "foo@foo.com";
string sFrom = txtFrom.Text.Trim();
string sSubject = "inforequest message" + DateTime.Now.ToLongDateString();
string sBody = txtContent.Text.Trim();
lblStatus.Text = "Sending... please wait";
MailMessage msg = new MailMessage(sFrom, sTo, sSubject, sBody);
msg.IsBodyHtml = false;
SmtpClient mailObj = new SmtpClient("mail.foo.com");
mailObj.Credentials = new NetworkCredential("user", "secret");
mailObj.Send(msg);
lblStatus.Text = "Sent " + msg.Subject + " to " + msg.To;
references: link
Note: I used "localHost" instead of "mail.foo.com".
1 comment:
Zu diesem Thema sagen es kann lange. viagra online bestellen rezeptfrei cialis online [url=http//t7-isis.org]viagra online[/url]
Post a Comment