Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have written a email code it works fine locally but when i uploaded this code to GoDaddy server nothing heppens even not showing me any error.

Why i am getting this problem, can anybody help me to solve this issue?

Please reply....

below is my code....


C#
protected void btnSubmit_Click(object sender, EventArgs e)
   {
       try
       {
           MailMessage Msg = new MailMessage();
           // Sender e-mail address.
           Msg.From = new MailAddress(txtEmail.Text);
           // Recipient e-mail address.
           Msg.To.Add("xxxxx");
           Msg.Subject = txtSubject.Text;
           string details = txtmobile.Text + '\n';
           Msg.Body = details + txtMessage.Text;
           // your remote SMTP server IP.
           SmtpClient smtp = new SmtpClient();
           smtp.Host = "smtpout.secureserver.net";
           smtp.Port = 80;
           smtp.Credentials = new System.Net.NetworkCredential("xxxx", "xxxx");
           smtp.EnableSsl = false;
           smtp.Send(Msg);
           //Msg = null;
           lbltxt.Text = "Thank you for contacting us.";
           // Clear the textbox valuess
           txtName.Text = "";
           txtSubject.Text = "";
           txtmobile.Text = "";
           txtMessage.Text = "";
           txtEmail.Text = "";
       }
       catch (Exception ex)
       {
           Console.WriteLine("{0} Exception caught.", ex);
       }
   }
Posted
Updated 8-Jun-14 20:33pm
v2
Comments
Prasad Khandekar 9-Jun-14 3:35am    
Try setting the MailMessage.From to the email address provided to you by GoDadday.

Regards,

1 solution

This two things can help you identify the issue:

godaddy email settings asp.net[^]

Contact GoDaddy.com[^] in order to get support from there. Its always better to ask what you pay for.

Regards..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900