ASP.NET - email resolute control - Asked By Anandh Ramanujam on 06-Jan-12 10:18 AM

hi,

Im sending email from my application.

Instead of typing valid email address in Address bar, is there any source to resolute the email id?

for example, if i type my employee number, that should be automatically resoluted to my email address as like in our outlook.

Any body help me in this regards.

Thanks.
dipa ahuja replied to Anandh Ramanujam on 06-Jan-12 10:36 AM
You can take bind the users inside one dropdown and get email on the textBox when value changes from ddList
for ex:

First set the AutoPostBack=True for all the dropdownlist. then implement the selectedIndexChanged This way   Bind dropdown with usernames and on Implement its selectgedIndexChange
 
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
  string s = DropDownList1.SelectedValue.ToString();
  SqlConnection conn = new SqlConnection();
  conn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
  SqlDataAdapter da = new SqlDataAdapter("select email from table1 where user='" + s + "'", conn);
  DataTable dt = new DataTable();
 
  da.Fill(dt); // Fill the dataset
  txtEmail.Text = dt.Rows[0][0];

}
 
 
[)ia6l0 iii replied to Anandh Ramanujam on 06-Jan-12 11:29 AM
Is Active directory the source that contains the employee number and the employee email? Or is it a database?

If it is a database, then you need to do a lookup with jQuery. Perhaps jQuery autocomplete control is a good choice for this. 

If you are using Active directory, do a search against it using the same jQuery autocomplete control. Your web service should do the filtering or the lookup for you.
kalpana aparnathi replied to Anandh Ramanujam on 06-Jan-12 02:16 PM

Resolve this security warning

  • If you did not expect a program to access Outlook, or if you are not sure whether the program attempting to access Outlook is trustworthy, click Deny.
  • If you clicked a command or started a program that you know is supposed to access Outlook data or send e-mail messages using Outlook, and you consider the program to be trustworthy, do one of the following:
    • Click Allow.
    • If you are prompted to allow access to recipient information, select the Allow access for check box, click the amount of time that you want to grant access for, and then click Allow

http://office.microsoft.com/en-us/outlook-help/i-get-warnings-about-a-program-accessing-e-mail-address-information-or-sending-e-mail-on-my-behalf-HA001229943.aspx