网络邮件发送问题 [英] web mail send problem
本文介绍了网络邮件发送问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从我的asp.net应用程序发送电子邮件
我已成功将.com域的aspx页面的电子邮件发送给我.
通过以下代码
I want to send email from my asp.net application
I have successfully sent the email form my aspx page for .com domain
by the following code
MailMessage msg = new MailMessage();
msg.From = new MailAddress("support@mydomain.com");
msg.To.Add("recipiant@gmail.com");
msg.Subject = "Demo Subject";
msg.Body = "Hey Test email";
SmtpClient client = new SmtpClient();
client.Host = "mail.mydomain.com";
client.Port = 25;
client.Credentials = new NetworkCredential("username", "password");
client.Send(msg);
但是,如果是.org域,则不会发送电子邮件
我已将以下代码用于.org域
But in case of .org domain it is not going email
I have used the below code for .org domain
MailMessage msg = new MailMessage();
msg.From = new MailAddress("support@mydomain.org");
msg.To.Add("recipiant@gmail.com");
msg.Subject = "Demo Subject";
msg.Body = "Hey Test email";
SmtpClient client = new SmtpClient();
client.Host = "mail.mydomain.org";
client.Port = 25;
client.Credentials = new NetworkCredential("username", "password");
client.Send(msg);
在提交的用户名中,我仅输入了不带域名的用户名.
因此,当我使用.com域时首先发送
但是当我使用具有正确ID和密码的.org邮件时,一个错误便抛出了我,称为:
In user name filed i have entered only user name not with domain name.
so first sent when i have used for .com domain
but when i have used .org mail with correct id and password, then one error is throwing me, called:
Mailbox unavailable. The server response was: Authentication is required for relay
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: Authentication is required for relay
推荐答案
检查
support@mydomain.org是有效的邮件ID.
和
mail.mydomain.org是SMTP服务器.
可能是
mail.mydomain.com可以用作SMTP服务器,但不能用作组织.
Check
support@mydomain.org is valid mail id.
and
mail.mydomain.org is SMTP Server.
It may be that
mail.mydomain.com works as SMTP Server but org not.
这篇关于网络邮件发送问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文