Jump to content


Check out our Community Blogs

Mukesh

Member Since 03 Oct 2013
Offline Last Active Oct 03 2013 10:38 PM
-----

Posts I've Made

In Topic: C# - Sending Email Through SMTP.

03 October 2013 - 07:04 AM

Hello All,

 

I Have followd  the step of sening email through smtp.

 

i coded like below

 

protected void btnSubmit_Click(object sender, EventArgs e)
    {

        NetworkCredential cred = new NetworkCredential("info@jjinteriorsdelhi.com", "xxxxxxx");
        MailMessage Msg = new MailMessage();
        Msg.To.Add("mukeshbhagat4u@hotmail.com");
        Msg.From = new MailAddress("info@jjinteriorsdelhi.com");
        Msg.Subject = "Enquiry for Interior Design";
        string sMessage = "Dear  Admin, <br /><br />"
        + "Another user seeking for interior design through www.jjinterirorsdelhi.com<br /><br />";
        sMessage += "<u>Following are the User details :</u><br /><br /> Name: " + txtName.Text
        + "<br />Email: " + txtEmail.Text
        + "<br />Phone: " + txtPhone.Text
        + "<br />Message: " + txtMsg.Text;
        Msg.Body = sMessage;
        SmtpClient client = new SmtpClient("smtp.live.com", 995);
        client.Credentials = cred;
        client.EnableSsl = true;
        client.Send(Msg);
        lblSendMsg.Visible = true;
        lblSendMsg.Text = "Your Enquiry has been sent sucessfully. Thank you";
    }

 

Then it throw error like below--

 

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 65.55.162.200:995

 

how can i Solve it.

 

 


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download