Page view counter

Email with Godaddy please look at my code and tell me whats wrong

Last post 08-28-2008 12:34 PM by norchnou. 7 replies.

Sort Posts:

  • Email with Godaddy please look at my code and tell me whats wrong

    03-02-2008, 11:07 PM
    • Loading...
    • norchnou
    • Joined on 01-07-2007, 8:41 PM
    • Posts 265

    For some reason i keep having this error:

    System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> 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 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at WUC_EmailContactUsForm.LinkButton1_Click(Object sender, EventArgs e)

    Here is my code:

    protected void LinkButton1_Click(object sender, EventArgs e)

    {

    MailMessage message = new MailMessage("webmaster@my-tribe.net", "jonathan@my-tribe.net");

    Label AdditionalInfos = new Label();

    message.IsBodyHtml = true;

    message.Body = tbMessage.Text + "<br />" + AdditionalInfos.Text + "<br /> Sent on: " + System.DateTime.Today.Date.ToShortDateString() + " at: " + System.DateTime.Today.TimeOfDay.ToString();

    AdditionalInfos.Text = "A Reply may neet to be send to" + tbEmail.Text + "<br /> Filled under: " + ddl.SelectedValue + "<br/> <br/>";

    SmtpClient Client = new SmtpClient("relay-hosting.secureserver.net", 587);

    Client.EnableSsl = true;

    Client.UseDefaultCredentials = false;

    Client.Credentials = new System.Net.NetworkCredential("webmaster@my-tribe.net", "Password");

    try

    {

    Client.Send(message);

    }

    catch (Exception error)

    {

    Response.Write(
    "Email send failed, Please try again!<br />" +error);

    }

     

    Thx

     

  • Re: Email with Godaddy please look at my code and tell me whats wrong

    03-04-2008, 4:00 AM

    Hi norchnou,

    You should test whether you can connect the server correctly. please use the bellow command at the cmd.exe window.

    telnet webmaster@my-tribe.net 587.

    If not,please close your firewall to try it.and check whether your emai host and port is correct.

    The usual port used to send emai is 25.

    Also, you can try other emai  host to try it.

    Here is a article, you can take time to read it.

    http://www.systemnetmail.com/

    Let me know if I have misunderstood what you mean.
    Thanks.
    Hope it helps,
    Hua Jun

     

    Sincerely,
    Hua Jun Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Email with Godaddy please look at my code and tell me whats wrong

    03-04-2008, 5:35 AM
    Answer
    • Loading...
    • mclead99
    • Joined on 05-06-2007, 7:33 PM
    • Iowa
    • Posts 69

    Dump the port assignment on your smtp line.  I use GoDaddy on several sites, I have the following in my webconfig:

    <system.net>
            <mailSettings>
                <smtp>
                    <network host="relay-hosting.secureserver.net"/>
                </smtp>
            </mailSettings>
        </system.net>

     

    in my code behind (vb):

    Dim smtp As New SmtpClient("relay-hosting.secureserver.net")

                    '(4) Send the MailMessage (will use the Web.config settings)
                    smtp.Send(mm)
    Please remember to Mark As Answer if the post helped
  • Re: Email with Godaddy please look at my code and tell me whats wrong

    03-04-2008, 11:48 AM
    • Loading...
    • norchnou
    • Joined on 01-07-2007, 8:41 PM
    • Posts 265

    Thx for your post.

    I will try that tonight

  • Re: Email with Godaddy please look at my code and tell me whats wrong

    03-05-2008, 12:59 AM
    • Loading...
    • norchnou
    • Joined on 01-07-2007, 8:41 PM
    • Posts 265

    HI

    I've disabled Norton,

    I've try your setting and still got this error coming

    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

    ___________________________________

    Regarding your other post,

    I have the same error as above coming

    Maybe because I am under Windows vista (ultimate 64b)

    I cant find IIS and set up email, myabe that is the reason.

     

    Otherwise some people recommended me to use cmd.exe

    than telnet relay-hosting.secureserver.net

    but it says telnet is not reconized

     

    I really need some help

  • Re: Email with Godaddy please look at my code and tell me whats wrong

    03-09-2008, 1:12 AM
    • Loading...
    • norchnou
    • Joined on 01-07-2007, 8:41 PM
    • Posts 265

    Anyone can help me out with this?

  • Re: Email with Godaddy please look at my code and tell me whats wrong

    06-05-2008, 11:54 AM
    • Loading...
    • falraie
    • Joined on 04-04-2006, 3:54 AM
    • Posts 14
    I don't know if you solved your problem yet with Godady, because I'm facing the same problem too.
    My question to you would be is that did they move you to a new server, because this started happening to me when they moved my site to a new server
    the problem is not in your code. The problem is on their server. The server is not allowing the communication with the SMTP. I have spent an hour on the phone with them and they wouldn't look into it. So I'm so unhappy with them and looking for a new home for my site. Because I have tested the site from my local server and it works fine for me
    Fares Alraie
    Senior Technical System Analyst
    OSSS
    RBC Online Self Service Solutions
  • Re: Email with Godaddy please look at my code and tell me whats wrong

    08-28-2008, 12:34 PM
    • Loading...
    • norchnou
    • Joined on 01-07-2007, 8:41 PM
    • Posts 265

    Actually,

    It was not working on local but once I've uploaded the page everything worked fine.

    their Customer service is pretty shitty, they look on google to find solution to whatever you ask them...

Page 1 of 1 (8 items)
Microsoft Communities