ASP.Net 邮件发送问题
我想通过 ASP.Net 发送邮件。但是,这给了我“SendUsing”错误。
代码:
<%
string strKime = "[email protected]";
string strKimden = "[email protected]";
string strKonu = "ASP.net mail gönderme işlemi";
string strMetin = "Bu sayfa asp.net mail komponenti tarafından gönderildi";
System.Web.Mail.SmtpMail.Send(strKimden, strKime, strKonu, strMetin);
%>
I want to send a mail with through ASP.Net.But,that's gives me "SendUsing" error.
Code:
<%
string strKime = "[email protected]";
string strKimden = "[email protected]";
string strKonu = "ASP.net mail gönderme işlemi";
string strMetin = "Bu sayfa asp.net mail komponenti tarafından gönderildi";
System.Web.Mail.SmtpMail.Send(strKimden, strKime, strKonu, strMetin);
%>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许 SMTP 服务器配置不正确?建议我们在调用 System.Web.Mail 组件或 CDO 时始终指定明确的 smtp 服务器名称。
不确定您是否直接在标记中使用它。理想情况下,您应该有一个通用代码来发送带有所需参数的电子邮件。查看其他答案之一中的链接。
Perhaps, SMTP Server is not configured correctly? it is recommended that we always specify the definite smtpserver names for when calling the System.Web.Mail components or CDO.
Not sure if you are using this directly in the markup. Ideally, you should have a common code that sends emails taking the required parameters. Check out the link in one of the other answers.
您是否在
web.config
文件中添加了SMTP
设置?电子邮件发送需要
SMTP
设置。Did you add the
SMTP
settings in theweb.config
file?Email sending requires
SMTP
settings.您必须将 SmtpClient Host 属性设置为“mail.hot.com”或外发邮件服务器的 IP。
You have to set the SmtpClient Host property to the "mail.hot.com" or the ip of your outgoing mail server.