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
Post a Comment