Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

.NET Forum


You are currently viewing our .NET Forum as a guest. Please register to participate.
Login



Reply
Old 12-11-2007, 01:56 PM ASP.Net Email form
Silent77's Avatar
Ultra Talker

Posts: 269
Name: Silent
Location: Ohio
Trades: 0
I am currently using ASP.Net and I am trying to make an contact form on a webpage (contact.aspx) and I want the contact form to send the values of the text boxes to my email address in an email. I was trying to use smtp and such but I couldn't get any of it to work because I was told I would have to use IIS on my webhost. So does anyone have a light weight email contact form? Thank You.
__________________
Firefox
rediscover the web

Please login or register to view this content. Registration is FREE
Down with internet explorer!
Silent77 is offline
Reply With Quote
View Public Profile Visit Silent77's homepage!
 
 
Register now for full access!
Old 12-12-2007, 06:27 AM Re: ASP.Net Email form
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's CDOSYS you need to use for sending SMTP emails on a Windows host.

function for sending the message;
http://www.candsdesign.co.uk/article...-email/cdosys/ written in ASP VbScript though
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-15-2008, 10:31 PM Re: ASP.Net Email form
ozzozo's Avatar
Experienced Talker

Latest Blog Post:
Customer Support Whitepaper
Posts: 44
Trades: 0
Try this:

http://www.developer.com/net/asp/article.php/3096831
__________________

Please login or register to view this content. Registration is FREE
- FAQ Management Software
ozzozo is offline
Reply With Quote
View Public Profile Visit ozzozo's homepage!
 
Old 03-01-2008, 09:09 AM Re: ASP.Net Email form
Novice Talker

Posts: 5
Name: Scott Baldridge
Location: Nashville, TN
Trades: 0
This works for me:

Dont forget this reference
Imports System.net.Mail

This is the code behind:
Private Sub ClearControls()
ddlContact.SelectedIndex = 0
txtMessage.Text = ""
txtName.Text = ""
txtEmail.Text = ""
txtPhone.Text = ""
End Sub
Private Sub SendMessage()
Try
Dim emFrom As String = txtEmail.Text
Dim emTo As String = ddlContact.SelectedValue
Dim MailObj As New MailMessage
MailObj.From = New MailAddress(emFrom)
MailObj.To.Add(emTo)
MailObj.Body = ("From:" & txtName.Text & "<br>" & " Message: " & txtMessage.Text)
MailObj.IsBodyHtml = True
Dim smtp As New SmtpClient("whatever your hosting provider gives you")
smtp.Send(MailObj)
ClearControls()
lblMessage.Visible = True
lblMessage.Text = "Thank you for your message! We will be in contact with you as soon as possible."
Catch
lblMessage.Text = "We are sorry but your message did not go through. Please call us for assistance @ 555-555-5555."
End Try
End Sub
Protected Sub btnClear_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnClear.Click
Response.Redirect("Contact.aspx")
End Sub
Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles btnSend.Click
Page.Validate()
If Page.IsValid Then
SendMessage()
End If
End Sub
GoGetSome is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to ASP.Net Email form
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.18648 seconds with 12 queries