Sunday, 15 August 2010

How to send email notification to newly created user in Active Directory using ASP.net C# -



How to send email notification to newly created user in Active Directory using ASP.net C# -

i have implemented web application manage operations(user creation, user modification, user termination) on active directory(@server.local).

i want send email @server.local domain when user creation has done, need notify manager of user.

now problem is, not sure smtp configuration settings on advertisement server , have tried method send mail. not send mail service successfully. showing error message failure sending mail.

my code is:

string smtphost = "10.26.60.350"; string fromaddress = "admin.user@server.local"; string toaddress = "test.user@server.local"; system.net.mail.mailmessage notmess = new system.net.mail.mailmessage(); notmess.to.add(toaddress); notmess.subject = subject; notmess.from = new system.net.mail.mailaddress(fromaddress); notmess.body = bodyparams; system.net.mail.smtpclient smtp = new system.net.mail.smtpclient(smtphost); smtp.send(notmess); // here getting exception

how resolve propblem? need configure settings on advertisement server send mail service using @server.local domain? please help me on , suggest me this.thanks

c# asp.net email active-directory smtpclient

No comments:

Post a Comment