c# - Sending Email from HTML Using ASP.Net -
i have developed website using html pages in visualstudio2012 asp.net empty website template. in web site looking contact us page, send email. possible send email using asp.net .html page?
i aware of sending email .aspx pages may contain either asp controls or html controls using asp.net.
here looking for, send email .html pages only.
to more specific, have sendemail() method need pass email address , email content .html page. how can achievable ?
thanks in advance.
personally have form post http handler (they end in .ashx) processing in asp.net. handler can read in passed fields form , send e-mail via sendemail() method.
for example, in html:
<form action="email.ashx" method="post"> <input type="text" name="email" /> <input type="text" name="content" /> <button type="submit">submit</button> </form> then http handler:
public class emailhandler : ihttphandler { public void processrequest(httpcontext context) { string email = context.request.form["email"]; string content = context.request.form["content"]; sendemail(email,content); } private void sendemail(string address, string content) { ... } } this very rough gives little more go on.
Comments
Post a Comment