System.Security.SecurityException when sending email using GMAIL Account on Godaddy Shared Hosting server

on Apr 24, 2013 11:11 PM

Sir i created a feedback form in which i receives user feedback on my  mail id once or twice the user is able to give feedback bt the error page pops up.Is the gmail that creating problem.

it shows custom error problem.But twice i was able to receive mail but after this i started getting this problem

or in web.config i have to add some security credentials

 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        MailMessage mail = new MailMessage();
        mail.To.Add(TextBox1.Text(user enters his mail address));
        mail.From = new MailAddress("myemail");
        mail.Subject = "Thanks For Registering";
        string body =" ";
        mail.Body = body;
        mail.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient();
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtp.EnableSsl = true;
        smtp.Host = "";
        smtp.Port = 587;
        smtp.Credentials = new System.Net.NetworkCredential("mymailaddress", "password");
        TextBox1.Text = "";


Download FREE API for Word, Excel and PDF in ASP.Net: Download
on Apr 24, 2013 11:53 PM

Problem is Godaaddy does not allow to send email from other servers. There's nothing you can do. Contact Go Daddy