如何获取我的 smtp 主机?
我编写了一个网站。我想向用户发送一条消息..现在在配置文件中的asp.net中..我这样写:
<mailSettings>
<smtp from="[email protected]">
<network host="localhost" port="25" userName="username" password="secret" defaultCredentials="true" />
</smtp>
</mailSettings>
我不知道网络主机的行为方式以及它的作用..我想将其更改为服务器那保存着我的雅虎帐户。我知道 smtp 是一些发送电子邮件的电子邮件服务器..但我如何获取它?它看起来怎么样?它是一个整数,还是一个字符串?!?
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]");
message.To.Add(new MailAddress("[email protected]"));
message.CC.Add(new MailAddress("[email protected]"));
message.Subject = "This is my subject";
message.Body = "This is the content";
SmtpClient client = new SmtpClient();
client.Send(message);
配置文件:
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.yahoo.com" port="25" userName="username" password="secret" defaultCredentials="true" />// where do i get the host?!? the host prevents me from sending an email
</smtp>
</mailSettings>
i program a site. and i want to send a message to the user.. now in asp.net in the config file.. i put this:
<mailSettings>
<smtp from="[email protected]">
<network host="localhost" port="25" userName="username" password="secret" defaultCredentials="true" />
</smtp>
</mailSettings>
i have no idea how the network host acts and what it does.. i want to change it to the server that holds my yahoo account. i understand that smtp is some email server that sends emails out.. but how do i put obtain it? how does it look like,? is it an int, is it a string?!?
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]");
message.To.Add(new MailAddress("[email protected]"));
message.CC.Add(new MailAddress("[email protected]"));
message.Subject = "This is my subject";
message.Body = "This is the content";
SmtpClient client = new SmtpClient();
client.Send(message);
config file:
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.yahoo.com" port="25" userName="username" password="secret" defaultCredentials="true" />// where do i get the host?!? the host prevents me from sending an email
</smtp>
</mailSettings>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看看雅虎!有关 SMTP 服务器设置的邮件帮助页面。看来您需要成为雅虎!然而,Mail Plus 帐户持有者可以访问 POP 和 SMTP 服务器。也许您可以使用另一个邮件帐户 - 您的网络托管提供商的 SMTP 服务器将是最好的选择。阅读网络托管服务商的帮助页面。
Look at Yahoo! Mail help pages for settings for their SMTP server. It looks like you need to be a Yahoo! Mail Plus account holder to access POP and SMTP servers however. Maybe you can use another mail account - your web hosting provider's SMTP server would be the best one to use. Read your web host's help pages.
网络主机是将处理电子邮件发送的物理服务器(SMTP 服务器)的地址。它可以是IP 地址或域名的形式(例如mail.mydomain.com)。如果您在一家公司工作,他们应该向您提供此信息,
Network host is the address of the physical server (SMTP server) that will handle the sending of email. It could be in a form of IP address or a domain name (e.g. mail.mydomain.com). If you are working on a company they should provide this to you,
选择
Alternative