Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i am face some problem. we purchase a domain from google & create an (info@)email id on this domain but hosting is created on godaddy server & my website is uploaded on godaddy server. i want to send a feedback on my info id from our gmail account & i am using this code but the error is - falier sending mail

try { string strBody = "Feedback
" + " Name  :  " + txtname.Text + "
" + " Email ID  :  " + txteid.Text + "
" + " Mobile   :  " + txtmob.Text + "
" + " Question  :  " + txtq.Text + "
" + ""; System.Net.Mail.MailMessage MyMailMessage = new System.Net.Mail.MailMessage("sales@domain.com", "sales@domain.com", "Feedback", strBody);

        MyMailMessage.IsBodyHtml = true;
        System.Net.NetworkCredential mailAuthentication = new
        System.Net.NetworkCredential("mail@gmail.com", "Password");
        System.Net.Mail.SmtpClient mailClient = new
        System.Net.Mail.SmtpClient("smtp@gmail", 25);

        mailClient.EnableSsl = true;
        mailClient.UseDefaultCredentials = false;
        mailClient.Credentials = mailAuthentication;
        mailClient.Send(MyMailMessage);

        lblstatus.Text = "Email successfully sent.";
    }
    catch (Exception ex)
    {
        lblstatus.Text = "Send Email Failed." + ex.Message;
    }  
share|improve this question
add comment

1 Answer

You could try sending via the GoDaddy SMTP service that comes with your hosting. There's a lot of reasons you may be having this problem. A good place to start would be to check on the GoDaddy help and make sure there's no restrictions on opening SMTP sessions to other servers on your hosting. Next check with Gmail and see if other people have this problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.