尝试以其访问权限74.125.206.109:587禁止的方式访问套接字 [英] An attempt was made to access a socket in a way forbidden by its access permissions 74.125.206.109:587
问题描述
    MailMessage mail = new MailMessage();
          SmtpClient SmtpServer =新的SmtpClient("smtp.gmail.com");
          mail.From = new MailAddress(" xxxxxxxxx@gmail.com");
          mail.To.Add(" Info@siyandisasolutions.co.za");
          mail.Subject =" Contact Form"; $
          mail.Body =" Entity:\ n" + entity +" \\\
Trading:" +交易+" \ n公司注册号码:" +公司+" \ n联系人:" +联系人+" \\\
Designation
:" +名称+" \\\
电话号码:" +电话+" \ nMobile号码:" + mobile +" \ nEmail地址:" +电子邮件+" \\\
Enquiry:" +区域+&'\ n来自CEO的询问:"
+ a;
          SmtpServer.Port = 587;
          SmtpServer.Credentials = new System.Net.NetworkCredential(" kxxxxxxx"," Kxxxxxxxxx");
          SmtpServer.EnableSsl = true;
          SmtpServer.Send(邮件);
以前工作过,现在给我的是低于错误
尝试进行以访问权限禁止的方式访问套接字74.125.206.109:587
请建议
显然它看起来像是权限问题,在此之前您可能有权使用此特定IP和端口发送电子邮件,但现在它似乎已被撤销,否则您的代码看起来很好,如果没有与网络相关的
权限问题,它应该可以正常工作。
谢谢,
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("xxxxxxxxx@gmail.com");
mail.To.Add("Info@siyandisasolutions.co.za");
mail.Subject = "Contact Form";
mail.Body = "Entity :\n" + entity + "\nTrading :" + trading + "\nCompany registration Number:" + company + "\nContact person :" + contact + "\nDesignation
:" + designation + "\nTelephone Number :" + telephone + "\nMobile Number :" + mobile + "\nEmail Address :" + email + "\nEnquiry :" + area + "\nEnquiry from CEO :"
+ a;
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("kxxxxxxx", "Kxxxxxxxxx");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
It was working before , now is giving me the below error
An attempt was made to access a socket in a way forbidden by its access permissions 74.125.206.109:587
please advice
Apparently it looks like to be the permissions issue, before that you might had permissions to send email using this particular IP and port but now it seems to be revoked, otherwise your code looks fine and it should work if there are no network related permissions issue.
Thanks,
这篇关于尝试以其访问权限74.125.206.109:587禁止的方式访问套接字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!