给我解决我的问题 [英] Give me solution for my question

查看:65
本文介绍了给我解决我的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我试图

1.go开始>运行

2.typeinetmgr在运行中按ok

i我收到的错误就像windows找不到并确保



i想用Asp.net发送邮件

 使用系统; 
使用 System.Collections;
使用 System.Configuration;
使用 System.Data;
使用 System.Linq;
使用 System.Web;
使用 System.Web.Security;
使用 System.Web.UI;
使用 System.Web.UI.HtmlControls;
使用 System.Web.UI.WebControls;
使用 System.Web.UI.WebControls.WebParts;
使用 System.Xml.Linq;
使用 System.Net.Mail;

// 现在打开你的.aspx页面用以下代码替换page_load

受保护 void Page_Load( object sender,EventArgs e)
{
MailMessage message = new MailMessage();

尝试
{
MailAddress fromAddress = new MailAddress( pallelokanathareddy@gmail.com Lokanatha);
message.From = fromAddress;
message.To.Add( pallelokanathareddy@gmail.com);
message.Subject = 反馈;
message.IsBodyHtml = false ;
message.Body = Hello Lokanatha;
sendmails(留言);
Label1.Text = 电子邮件已成功发送。;
}
catch (例外情况)
{
Label1.Text = 发送电子邮件失败。 + ex.Message;
}
}

public void sendmails( MailMessage mm)
{
SmtpClient smtp = new SmtpClient();
smtp.Host = smtp.gmail.com;
smtp.EnableSsl = true ;
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
NetworkCred.UserName = pallelokanathareddy@gmail.com;
NetworkCred.Password = 你是上面代码中提到的邮件id的实际gmail密码; ;
smtp.UseDefaultCredentials = true ;
smtp.Credentials = NetworkCred;
smtp.Port = 587 ;
smtp.Send(mm);
}



Smtp设置:



注意:smtp服务器应安装在您的计算机上。你的系统必须有互联网连接

1.go开始>运行

2.typeinetmgr在运行中按ok

3。在新开的互联网服务经理导航到默认smtp虚拟服务器

4.go到域右键单击新>域

5.选择远程并单击下一步smtp .gmail.com并点击完成。

6.现在转到默认smtp虚拟服务器右键单击选择属性并单击。

7.in ip地址下拉菜单选择你的系统IP。

8.转到访问标签点击继电器

9.selectradio buton仅下面的列表并检查允许所有成功完全认证的计算机进行中继。无论上面的列表如何点击确定。

10.在连接选择中只有下面的列表点击确定。

11.单击身份验证按钮,选择匿名访问单击好的。

12.关闭你的iis窗口。





帮助我哪些文件必不可少

解决方案

inetmgr位于 C:\ Windows \ System32 \inetsrv 文件夹中,因此请尝试运行 C:\ Windows \ System32 \inetsrv \inetmgr 而不仅仅是 inetmgr



如果要在没有完整文件路径的情况下调用inetmgr,请将 C:\ Windows \ System32 \inetsrv 添加到环境变量路径:

http://www.computerhope.com/issues/ch000549.htm [ ^ ]


< blockquote>当你去inetmgr ..你正在打开IIS管理器...你需要安装IIS inorder inetmgr命令才能工作..


When ever i tried to
1.go to start>run
2.type "inetmgr" in the run press ok
i am getting error Like" windows can't find and make sure "

i want to send a mail by using Asp.net

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net.Mail;

// Now open your .aspx page replace the page_load with below code

protected void Page_Load(object sender, EventArgs e)
{
   MailMessage message = new MailMessage();

   try
   {
      MailAddress fromAddress = new MailAddress("pallelokanathareddy@gmail.com", "Lokanatha");
      message.From = fromAddress;
      message.To.Add("pallelokanathareddy@gmail.com");
      message.Subject = "Feedback";
      message.IsBodyHtml = false;
      message.Body = "Hello Lokanatha";
      sendmails(message);
      Label1.Text = "Email successfully sent.";
   }
   catch (Exception ex)
   {
      Label1.Text = "Send Email Failed." + ex.Message;
   }
}

public void sendmails(MailMessage mm)
{
   SmtpClient smtp = new SmtpClient();
   smtp.Host = "smtp.gmail.com"; 
   smtp.EnableSsl = true;
   System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
   NetworkCred.UserName = "pallelokanathareddy@gmail.com";
   NetworkCred.Password = "youe actual gmail password for the mail id mentionaed in the above code"; ;
   smtp.UseDefaultCredentials = true; 
   smtp.Credentials = NetworkCred;
   smtp.Port = 587;
   smtp.Send(mm); 
}


Smtp settings:

note: smtp server should be installed in your computer.your system must have internet connection
1.go to start>run
2.type "inetmgr" in the run press ok
3.in the newly opened internet service manager navigate to "default smtp virtual server"
4.go to domain right click new>domain
5.select remote and click next"smtp.gmail.com" and click finish.
6.now go to "default smtp virtual server" right click choose "Properties" and click.
7.in the ip address dropdown choose your system ip.
8.go to "access" tab click on "Relay"
9.selectradio buton "only the list below" and also check "allow all the computers which success fully authenticate to relay.regardless of the list above" click ok.
10.in the connection select "only the list below" click ok.
11.click on "Authentication" button choose "Anonymous Acess" click ok.
12.close your iis window.


help me which files are essential

解决方案

inetmgr is located in the folder C:\Windows\System32\inetsrv, so try running C:\Windows\System32\inetsrv\inetmgr instead of just inetmgr.

If you want to call inetmgr without the full file path, add C:\Windows\System32\inetsrv to the environment variable PATH:
http://www.computerhope.com/issues/ch000549.htm[^]


When you go for inetmgr.. you are opening IIS Manager... You need to install IIS inorder inetmgr command to work..


这篇关于给我解决我的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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