Hello frens,
I am new to ASP.Net and I am trying to create an application where I want to send my form contents to my email ID. I used the 2 approaches.
1) HTML form:
<form enctype="multipart/form-data" runat=server action="mailto:abcd@efgh.com" method="post">
<p>Enter your name below:<br />
<input type="text" name="names" size="100" /></p>
<p><input type="submit" value="Submit Feedback" /><br />
<input type="reset" value="Reset Feedback" /></p>
</form>
While the above code does send me a email with the name entered in the text box "text1", it open MS Outlook when I click on "Submit" button and there I have to again click the Send Button in the Outlook Window. Is there anyway that I can send an email directly just by clicking the Submit button once rather than having to send through Outlook? Something like as soon as I click on the Submit button on my form, it send a email and gives a confirmation that the message was sent.
2) ASP.Net namespace System.Web.Mail:
using System.Web.Mail;
public partial class email : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SmtpMail.Send("abcd@efg.com", "ijkl@mnop.com", "Hiiiii", "body text here");
Response.Write("Success..!");
}
}
This approach does not work at all. It gives me the following exception.
System.Runtime.InteropServices.COMException: The "SendUsing" configuration value is invalid.
Do I need to give some SMTP server destination?
Please help...!
Thanks
Sharon.