Results 1 to 1 of 1

Thread: Sending email with ASP.NET in C#

  1. #1
    wraithlunati is offline x10Hosting Member
    Join Date
    Jul 2009
    Posts
    1

    Sending email with ASP.NET in C#

    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:

    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
    
    I though I was doing all this by the book but for the life of me I can't understand why it would fail...

    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!
    Last edited by wraithlunati; 07-24-2009 at 02:00 PM. Reason: Automerged Doublepost

Similar Threads

  1. Sending an email with python
    By purpleflame in forum Scripts, 3rd Party Apps, and Programming
    Replies: 9
    Last Post: 04-19-2009, 06:01 AM
  2. Simple PHP Email Sending Form
    By dquigley in forum Scripts, 3rd Party Apps, and Programming
    Replies: 10
    Last Post: 12-13-2008, 02:33 PM
  3. Profiting from “Unsolicited Email Marketing”
    By arkad in forum Classifieds
    Replies: 0
    Last Post: 11-17-2008, 11:43 PM
  4. Help me in sending Email
    By Nahid_hossain in forum Scripts, 3rd Party Apps, and Programming
    Replies: 1
    Last Post: 10-22-2008, 11:40 PM
  5. Sending Email
    By persiantnt in forum Free Hosting
    Replies: 0
    Last Post: 06-10-2008, 09:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
dedicated servers