sending to an email with contact form asp.net -


how go sending email specified email address contact form in asp.net? website hosted though hosting company. thanks

mailmessage mail = new mailmessage(); smtpclient smtpserver = new smtpclient("your.mail.server");  mail.from = new mailaddress("your_email_address@gmail.com"); mail.to.add("to_address@mfc.com"); mail.subject = "test mail"; mail.body = "this testing smtp mail";  smtpserver.credentials = new system.net.networkcredential("username", "password");  smtpserver.send(mail); 

Comments

Popular posts from this blog

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -

jQuery clickable div with working mailto link inside -