| | |
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 |
.net 2.0 activexcontrol advice ajax alltypeofvideos application asp asp.net bc30451 bottomasp.net box browser button c# c#gridviewcolumn checkbox click commonfunctions confirmationcodegeneration css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fileuploader fill flash form formatdecimal forms formview grid gridview gudi homeedition hosting iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security select silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





