Hello. I'm trying to figure out why i get an error when i try to use send an email from my website hosted here. I have this in the web.config <system.net> <mailSettings> <smtp from="[email protected]"> <network host="localhost" password="" userName="" /> </smtp> </mailSettings> </system.net> Do i need to set up an email address and password with DASP for this to work? Thanks, Tony Here is the error i'm getting: Server Error in '/' Application. A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond Source Error: Code: Line 76: smtp.UseDefaultCredentials = False Line 77: smtp.Credentials = a Line 78: smtp.Send(msgMail) Line 79: Response.Redirect("~/default.aspx") Line 80: End Sub Source File: E:\web\girgentiinf\htdocs\Admin\Email.aspx.vb Line: 78
Tony, Is the web.config snippet you posted from the same web.config file you posted here: http://community.discountasp.net/default.aspx?f=25&m=18306 If it is, please check that thread for a reply which may help solve the problem that you're running into. Winston DiscountASP.NET www.DiscountASP.NET
Hello Winston. It's not really the same web.config. It's been changed numerous times in my attempts to make this thing work. The basic part of it (<network host="localhost" port="25" password="" userName="" />) has always been the same. The guy that replied to my request never really answered my question. He replied with something that i did not understand and has not replied yet to my reply. His first reply could hardly be considered a resolution to my problem. Do you have any suggestions. Thanks, Tony
Tony, I'm glad I was the pair of eyes that was able to help you out. Good luck with your site and happy programming! Winston DiscountASP.NET www.DiscountASP.NET
Tony, Could you post the code from the Email.aspx.vb file or at least a few lines of the surrounding code so I can see what else is going on? Thanks! Winston DiscountASP.NET www.DiscountASP.NET
Hello Winston. The problem was in the web.config. After you left your replyin the other post about: <add key="ClubMailServer" value="mail.club.com" /> <add key="ClubMailUsername" value="[email protected]" /> <add key="ClubMailPassword" value="password" /> I took it thru the debugger and discovered that what you suspected was happening. I changed them to what they should be and it allowed me to send an email without an error. I had asked about those fields in this forum and other forums, but never got an answer, so ijust assumedthat they were not a part of the problem. It seemed like my only problem was in the smtp settings. Thanks for all of your help. Tony