| | |
Email Application
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 25
Reputation:
Solved Threads: 0
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:
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:
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.
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:
html Syntax (Toggle Plain Text)
<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:
ASP.NET Syntax (Toggle Plain Text)
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.
Last edited by peter_budo; Mar 26th, 2009 at 10:59 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
hi,
check this code.you have to add name space
check this code.you have to add name space
ASP.NET Syntax (Toggle Plain Text)
imports system.net.mail sub sendmail() Dim msg As New MailMessage msg.From = txtEmail.Text msg.To = "info@some.co.in" 'msg.To = "n@yahoo.com" msg.Bcc = "n@some.co.in" msg.Subject = " Demo Info " msg.BodyFormat = MailFormat.Html Dim str As String msg.Body = mail(str) msg.Priority = MailPriority.High Try SmtpMail.SmtpServer = "localhost" SmtpMail.Send(msg) Catch ex As HttpException Catch ex As Exception Finally End Try End Sub
If u r query is achieved,mark the thread as solved
Live and Let Live
Live and Let Live
![]() |
Similar Threads
- How to send am Email using c# ? (C#)
- email application using php (PHP)
- Obfuscating email addresses in HTML (JavaScript / DHTML / AJAX)
- Send email (C#)
- Jobs: Application Developers (Software Development Job Offers)
- Send Email From my Application (ASP.NET)
- Email Sending Problem in ASP.NET (ASP.NET)
- Email application (Java)
- Sending email from c++ application (C++)
Other Threads in the ASP.NET Forum
- Previous Thread: Implement SilverLight with ASP.NET
- Next Thread: How To: Right to left TREE VIEW
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 ajax alltypeofvideos anathor appliances application asp asp.net bc30451 beginner box browser button c# cac checkbox commonfunctions complex control dataaccesslayer database datagridview datalist deployment development dgv dialog dropdownlist dynamic dynamically edit editing embeddingactivexcontrol expose feedback fileuploader fill findcontrol flash form formatdecimal formview gridview gudi iis image javascript languages list listbox login microsoft migration mobile mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent problem project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows schoolproject search security select sessionvariables silverlight smoobjects software sql-server sqlserver2005 ssl tracking treeview unauthorized validatedate validation vb.net videos vista visualstudio web webapplications webdevelopment webprogramming webservice xsl youareanotmemberofthedebuggerusers





