Click here to Skip to main content
15,888,908 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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
C#
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
Posted
Updated 22-Feb-15 5:39am
v3
Comments
stibee 23-Feb-15 1:47am    
The titel of your question is bad

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[^]
 
Share this answer
 
Comments
Wendelius 22-Feb-15 11:42am    
It seems that the code was just a diversion :)

Good links, 5.
Thomas Daniels 22-Feb-15 11:43am    
Thank you!
Santosh K. Tripathi 23-Feb-15 0:50am    
good information.
rathnambv 23-Mar-15 5:55am    
Thanks a Lot for giving best solutions for my question
When you go for inetmgr.. you are opening IIS Manager... You need to install IIS inorder inetmgr command to work..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900