Hi guys :) i am developing a website in ASP.NET using vb.net in the visual studios 2008 IDE. I am attempting to send an email from my website. i keep getting a "sending message failure" on my site. here is my code. hopefully somebody can be of assistance. much help appreciated. ContactUs.aspx.vb: Partial Class Default2 Inherits System.Web.UI.Page Protected Sub btnSend_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSend.Click Dim mailMessage As System.Net.Mail.MailMessage = New System.Net.Mail.MailMessage() mailMessage.From = New System.Net.Mail.MailAddress(txtFromAddress.Text.Trim()) mailMessage.To.Add(New System.Net.Mail.MailAddress(txtToAddress.Text.Trim())) mailMessage.Subject = txtSubject.Text.Trim() mailMessage.Body = txtBody.Text.Trim() Dim smtpClient As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient() smtpClient.Send(mailMessage) *THIS IS WHERE THE ERROR SHOWS UP WHEN I CLICK SEND*:confused::confused::confused: End Sub Here is my web.config file code: <system.net> <mailSettings> <smtp> <network host="localhost"/> </smtp> </mailSettings> </system.net> End Class thanks in advance!! :) Daithi
DaithiBoo
Posts
-
Email Sending...Help!!! -
Embedding a PDF File in an ASP.NET Website(vb.net)ya that did the trick!! :) thanks so much for the help!!
-
Embedding a PDF File in an ASP.NET Website(vb.net) -
Help with RSS feed C#Hello, I am having trouble getting an RSS feed to work on a college project, I am using code based on a tutorial I got from here http://blogs.msdn.com/coding4fun/archive/2006/10/31/912335.aspx When i try to run I am getting an error that looks a bit like this Server Error in '/' Application. -------------------------------------------------------------------------------- Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes the field 'rssFeed', but its type (RssList) is not compatible with the type of control (ASP.rsslist_ascx). Source Error: Line 7: Line 8: Line 9: <rss:feedControl ID="rssFeed" runat="server" /> Line 10: Line 11: Source File: /News.aspx Line: 9 Any help with this problem would be fantastic. Cheers, D
-
No results.. please try again messageya that did it! thanks a million for your help! very much appreciated!
-
No results.. please try again messageHi there.. :) im workin on a website at the moment in asp.net, using vb.net, in the visual studios 2008 IDE! i just wish to add an extra feature and hopefully someone out there might be able to help. I have a button that reads the values of 5 radio buttons in a radiobutton list, then queries the database, returning results based on the values selected. If no value is returned i wish to display a message saying "No Results this time, please search again" or something to that effect. Im not sure how to do this. here is the code i have behind the button.. Please advise. Protected Sub btnSuggest_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSuggest.Click Dim myConnection As SqlConnection Dim myCommand As SqlCommand Dim dr As SqlDataReader Dim varBatteryLifeQ As String = "" Dim varMemoryQ As String = "" Dim varRam As String = "" Dim varScreenSize As String = "" Dim varWebcam As String = "" myConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True") myConnection.Open() varBatteryLifeQ = RadioButtonList1.SelectedValue.ToString varMemoryQ = RadioButtonList2.SelectedValue.ToString varRam = RadioButtonList3.SelectedValue.ToString varScreenSize = RadioButtonList4.SelectedValue.ToString varWebcam = RadioButtonList5.SelectedValue.ToString myCommand = New SqlCommand("Select * From LPU400 Where BatteryLife = '" + varBatteryLifeQ + "' AND Memory = '" + varMemoryQ + "' AND RAM ='" + varRam + "' AND ScreenSize ='" + varScreenSize + "' AND Webcam ='" + varWebcam + "'", myConnection) SqlDataSource2.SelectCommand = "Select * From LPU400 Where BatteryLife = '" + varBatteryLifeQ + "' AND Memory = '" + varMemoryQ + "' AND RAMQ ='" + varRam + "' AND ScreenSize ='" + varScreenSize + "' AND Webcam ='" + varWebcam + "'" SqlDataSource2.DataBind() dr = myCommand.ExecuteReader() While dr.Read() End While dr.Close() myConnection.Close() End Sub Thanks in advance, Daithi