using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Reflection; using System.Net.Mail; using CMS.Util; public partial class kontakt_forma : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Email_TextChanged(object sender, EventArgs e) { } protected void Poruka_TextChanged(object sender, EventArgs e) { } protected void Posalji_OnClick(object sender, EventArgs e) { sendMailBrinkster(); } private void sendMailBrinkster() { //string mailTo = "tomislav@multi-design.biz"; string mailTo = "info@harmony-dance.hr"; string maleFrom = "info@harmony-dance.hr"; string subject = "Kontakt sa web stranice"; string body = null; string email = null; DateTime UtcNow = DateTime.UtcNow; //DateTime offset = DateTime. //Response.Write(DateTime.UtcNow); // email = Email.Text; body = Poruka.Text; // //Response.Write(MailSender.isEmail(email)); if (MailSender.isEmail(email)) { // body += "

" + email + "

Poruka poslana datuma: " + UtcNow.AddHours(2); //harmony@inet.hr MailMessage m = new MailMessage(); { m.From = new MailAddress(mailTo); m.To.Add(new MailAddress(maleFrom)); m.To.Add(new MailAddress("harmony@inet.hr")); m.Body = body; m.IsBodyHtml = true; m.Subject = subject; m.Priority = MailPriority.Normal; //Note you could add a lot more Options and also could add them to the Sub. } System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(); smtp.Credentials = new System.Net.NetworkCredential(Convert.ToString(maleFrom), "harmonydance"); smtp.Host = "sendmail.brinkster.com"; smtp.Send(m); // Poslano.Text = "Vaša poruka je poslana"; Email.Text = ""; Poruka.Text = ""; } else { Poslano.Text = "Pogrešno ste upisali email!"; } } }