从asp.net应用程序发送邮件失败,不允许使用邮箱名称 [英] sending mail from asp.net app fail, Mailbox name not allowed

查看:89
本文介绍了从asp.net应用程序发送邮件失败,不允许使用邮箱名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不允许使用邮箱名称.服务器响应为:很抱歉,您所在的位置[xxx.xx.xx.xxx](#5.7.1)
拒绝中继

我使用需要发送邮件的网页,使用下一个代码,但收到上述错误

Mailbox name not allowed. The server response was: sorry, relaying denied from your location [xxx.xx.xx.xxx] (#5.7.1)

i use a web page that i need to send mail, i use the next code, but i receive the above error

string emailFrom = "mail@yahoo.com";
            string emailTo = "samemail@yahoo.com"; 
            MailMessage mm = new MailMessage();
            mm.From = new MailAddress(emailFrom);
            mm.To.Add(new MailAddress(emailTo));
            mm.Subject =  txtEmpNameAr.Text;
            string body = txtEmpNameAr.Text.Trim() + "\n";
           
            body += txtNotes.Text.Trim();


            mm.IsBodyHtml = true;
            mm.Body = body;// txtNotes.Text.Trim();
            const string SERVER = "relay-hosting.secureserver.net";
            SmtpClient Client = new SmtpClient(SERVER, 25);
            Client.DeliveryMethod = SmtpDeliveryMethod.Network;
            Client.Credentials = CredentialCache.DefaultNetworkCredentials;
            Client.Send(mm);

推荐答案


这是一个类似的讨论:
发送邮件失败 [ http://asp.net-tutorials.com/misc/sending-mails/ [ ^ ]
使用ASP.NET和C#发送邮件/联系表 [ ^ ]

--Amit
Hi,
Here is a similar discussion:
Failure Sending Mail[^]

Refer these links also:
http://asp.net-tutorials.com/misc/sending-mails/[^]
Send Mail / Contact Form using ASP.NET and C#[^]

--Amit


我认为您的托管服务器存在问题,因为许多服务器不允许发送电子邮件的某些代码,而它们已经开发了仅用于发送的特定代码.因此,请联系托管服务器.他们会为您提供代码.
I think there is an issue from your hosting server because many servers not allowing some code for sending email they have developed some specific code that only used for send. So contact hosting server. They will provide you code for do so.


这篇关于从asp.net应用程序发送邮件失败,不允许使用邮箱名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆