I've been working on my website and I've run into a little snag.
:Background Info:
I'm hosted on lotus.x10hosting.com.
I can send emails from outlook using both admin and [email protected] to my gmail account no problem.
I'm trying to setup a confirmation emailer so that users can be verified.
:The Problem:
I have tested the code on my local IIS server and I get an SmtpException stating the request timed out.
Whenever I test the actual server, the page times out.
In neither of these instances, the email gets sent.
Here's the code from the hosted site:
I though I was doing all this by the book but for the life of me I can't understand why it would fail...Code:// Setup the client // I've tried lotus.x10hosting.com and mail.blacktiesoft.co.cc as well SmtpClient Client = newSmtpClient("localhost", 465); Client.EnableSsl = true; Client.UseDefaultCredentials = false; Client.Credentials = newNetworkCredential("[email protected]", "thepassword"); // Setup the message body... String MessageBody = ""; // ..removed to save space MailMessage Message = newMailMessage("[email protected]", Info.UserID, "Account Confirmation", MessageBody); bool failed = false; try { Client.Send(Message); } catch { failed = true; } if (failed == false) // Save the Users Information
Can someone shed some light on the subject? I've searched through the forums and haven't found any answers so I thought I fould finally ask.
Dave
Edit:
http://forums.x10hosting.com/free-ho...ing-email.html <-- due to bad description of what works and what doesn't, I never tried the second recommendation, turns out, the second one works!
To all those people that had this problem,
The "by the book method", using the System.Net.Mail namespace doesn't work...
The Method using the System.Web.Mail namespace worked like a charm!


LinkBack URL
About LinkBacks

