<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dot net development services &gt; Metasys Software Pvt Ltd.</title>
	<atom:link href="https://ikfstage.metasyssoftware.com/tag/dot-net-development-services/feed/" rel="self" type="application/rss+xml" />
	<link>https://ikfstage.metasyssoftware.com</link>
	<description></description>
	<lastBuildDate>Thu, 27 Apr 2023 13:04:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Using MailKit to Send Email Notifications in .Net Core</title>
		<link>https://ikfstage.metasyssoftware.com/microsoft-technologies/using-mailkit-to-send-email-notifications-in-net-core/</link>
		
		<dc:creator><![CDATA[meta_prasad]]></dc:creator>
		<pubDate>Wed, 19 Apr 2023 11:34:45 +0000</pubDate>
				<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[Dot Net Software Solutions]]></category>
		<category><![CDATA[Dot Net Core]]></category>
		<category><![CDATA[dot net]]></category>
		<category><![CDATA[.Net Core]]></category>
		<category><![CDATA[dot net development services]]></category>
		<category><![CDATA[MailKit]]></category>
		<category><![CDATA[DotNet]]></category>
		<category><![CDATA[DotNet Development Company]]></category>
		<category><![CDATA[Dot Net Development]]></category>
		<category><![CDATA[.Net Application Development]]></category>
		<guid isPermaLink="false">https://development.ikf.in/metasys1/?p=6066</guid>

					<description><![CDATA[<p>These days, most applications come with the ability to send email notifications. Sending an email in Dot Net is quite easy and can be accomplished using Simple Mail Transfer Protocol (SMTP). I have used SMTP in many of my web applications, and it is still available in .Net Core. So, why should you use MailKit? &#8230;</p>
<p class="read-more"> <a class="" href="https://ikfstage.metasyssoftware.com/microsoft-technologies/using-mailkit-to-send-email-notifications-in-net-core/"> <span class="screen-reader-text">Using MailKit to Send Email Notifications in .Net Core</span> Read More &#187;</a></p>
The post <a href="https://ikfstage.metasyssoftware.com/microsoft-technologies/using-mailkit-to-send-email-notifications-in-net-core/">Using MailKit to Send Email Notifications in .Net Core</a> appeared first on <a href="https://ikfstage.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></description>
										<content:encoded><![CDATA[<div id="pl-6066"  class="panel-layout" ><div id="pg-6066-0"  class="panel-grid panel-no-style" ><div id="pgc-6066-0-0"  class="panel-grid-cell" ><div id="panel-6066-0-0-0" class="so-panel widget widget_sow-editor panel-first-child panel-last-child" data-index="0" ><div
			
			class="so-widget-sow-editor so-widget-sow-editor-base"
			
		>
<div class="siteorigin-widget-tinymce textwidget">
	<p>These days, most applications come with the ability to send email notifications. Sending an email in Dot Net is quite easy and can be accomplished using Simple Mail Transfer Protocol (SMTP). I have used SMTP in many of my<a href="https://development.ikf.in/metasys1/service/web-app-development/"> web applications</a>, and it is still available in .Net Core.</p>
<p>So, why should you use MailKit? While implementing the email function in one of my .Net Core projects, I found out that Microsoft had deemed SMTP to be outdated. Instead, they recommended using the MailKit library. For more information, please check out the link below.<br />
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?WT.mc_id=AZ-MVP-5002809&amp;view=netcore-2.2" target="_blank" rel="noopener">https://docs.microsoft.com/en-us/dotnet/api/system.net.mail.smtpclient?WT.mc_id=AZ-MVP-5002809&amp;view=netcore-2.2</a></p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-1.jpg" alt="SMTP Client Class" /></p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-2.jpg" alt="SMTP Client Class 1" /></p>
<p>I have used MailKit library in my .Net Core project.</p>
<p>Here I will share how to use simple email sending function using MailKit library in .Net Core projects.</p>
<h2><strong>Implementation:</strong></h2>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-3.jpg" alt="Mailkit" /></p>
<p>After a successful installation, we can proceed further with the code.</p>
<p>1. Create a configuration class.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-4-1.jpg" alt="Configuration Class" /></p>
<p>2. Add the mail server settings in appsettings.json file, like shown below.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-5.jpg" alt="Mail Server Settings" /></p>
<p>3. Create one email message class.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-6-1.jpg" alt="Email Message Class" /></p>
<p>4. To encapsulate email sending functionality and to use it anywhere from the application we should create one interface and class like given below.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-7-1.jpg" alt="Email Sending Functionality" /></p>
<p>5. Create a new class and inherit interface.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-8-1.jpg" alt="Class and Inherit Interface" /></p>
<p>6. The code below is an implementation in class file EmailSender. Please don’t get confused with Smtp class used below in the code; this class belongs to MailKit library class. CreateEmailMessage method is a simple message creation method which we need to use to create a message using MimeMessage class.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-9.jpg" alt="Class File EmailSender" /></p>
<p>7. In the .Net Core project, we need to add dependency injection in Startup.cs file.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-10.jpg" alt="Dot Net Core Project" /></p>
<p>8. Now we are ready to use the send method and can call this method from anywhere in the application.</p>
<p><img decoding="async" src="https://development.ikf.in/metasys1/wp-content/uploads/2023/04/email-notifications-11.jpg" alt="Send Method" /></p>
<p>The implementation provided above is for the synchronous method. Similarly, we need to implement an asynchronous method for the send function. We can also add code to be able to send emails with attachments.</p>
<p>When calling the send method, we can use a string for the message body or even a dynamic template file. The BodyBuilder class can be used to build the body or content of the email. It can also be used to add data from the template file and then change the dynamic content.</p>
<p>I developed this in a .Net Core project, but the recommendation is to use the MailKit library in all new developments, even if the project is in the .Net framework. In older implementations, we can replace existing SMTP code with MailKit.</p>
<p>Partner with <a href="https://development.ikf.in/metasys1/">MetaSys Software</a>, the top <a href="https://development.ikf.in/metasys1/technologies/dot-net-solutions/">DotNet development company</a>, to build powerful and reliable software solutions that will drive your success. <a href="https://development.ikf.in/metasys1/contact/">Contact us</a> now to schedule a consultation and start your journey towards unparalleled growth!</p>
</div>
</div></div></div></div></div>The post <a href="https://ikfstage.metasyssoftware.com/microsoft-technologies/using-mailkit-to-send-email-notifications-in-net-core/">Using MailKit to Send Email Notifications in .Net Core</a> appeared first on <a href="https://ikfstage.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Implementing Active Directory in a .NET application with Multiple Roles</title>
		<link>https://ikfstage.metasyssoftware.com/implementing-active-directory-in-a-net-application-with-multiple-roles/</link>
		
		<dc:creator><![CDATA[meta_prasad]]></dc:creator>
		<pubDate>Wed, 18 Aug 2021 13:28:16 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Microsoft Technologies]]></category>
		<category><![CDATA[dot net development company]]></category>
		<category><![CDATA[dot net development services]]></category>
		<category><![CDATA[DotNet run]]></category>
		<category><![CDATA[DotNet framework]]></category>
		<category><![CDATA[DotNet Core 3.0]]></category>
		<guid isPermaLink="false">https://development.ikf.in/metasys1/?p=3566</guid>

					<description><![CDATA[<p>The need for a directory of users arises when various devices are used on the same network. It is crucial to locate the directory on one central source, known as Active Directory. It helps validate and authenticate multiple users accessing all resources on the domain with a single sign-on. In this blog, we will demonstrate &#8230;</p>
<p class="read-more"> <a class="" href="https://ikfstage.metasyssoftware.com/implementing-active-directory-in-a-net-application-with-multiple-roles/"> <span class="screen-reader-text">Implementing Active Directory in a .NET application with Multiple Roles</span> Read More &#187;</a></p>
The post <a href="https://ikfstage.metasyssoftware.com/implementing-active-directory-in-a-net-application-with-multiple-roles/">Implementing Active Directory in a .NET application with Multiple Roles</a> appeared first on <a href="https://ikfstage.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></description>
										<content:encoded><![CDATA[<div id="pl-3590"  class="panel-layout" >
<div id="pg-3590-0"  class="panel-grid panel-no-style" >
<div id="pgc-3590-0-0"  class="panel-grid-cell"  data-weight="1" >
<div id="panel-3590-0-0-0" class="so-panel widget widget_sow-editor panel-first-child panel-last-child" data-index="0" data-style="{&quot;background_image_attachment&quot;:false,&quot;background_display&quot;:&quot;tile&quot;,&quot;cvw_duration&quot;:&quot;300&quot;,&quot;cvw_easing&quot;:&quot;linear&quot;,&quot;cvw_anchor&quot;:&quot;top-bottom&quot;,&quot;cvw_repeat&quot;:&quot;true&quot;,&quot;iw-visible-screen&quot;:&quot;iw-all&quot;,&quot;iw-visible-layout&quot;:&quot;iw-all&quot;}" >
<div class="so-widget-sow-editor so-widget-sow-editor-base">
<div class="siteorigin-widget-tinymce textwidget">
<p>The need for a directory of users arises when various devices are used on the same network. It is crucial to locate the directory on one central source, known as Active Directory. It helps validate and authenticate multiple users accessing all resources on the domain with a single sign-on.</p>
<p>In this blog, we will demonstrate how to implement Active Directory in a .NET application.</p>
<p><img fetchpriority="high" decoding="async" class="wp-image-3567 size-full aligncenter" title="Login" src="https://development.ikf.in/metasys1/wp-content/uploads/2022/07/dotnet_1.png" alt="Login" width="378" height="166" /></p>
<h2><strong>What is Active Directory?</strong></h2>
<p>Active Directory is a database adapted by Microsoft to manage multiple devices on a single network. It also can be defined as a set of services that connect users with network resources they need to accomplish projects. In order to obtain access to devices, the network users require it to be validated.</p>
<p>Let us consider a C# .NET application to validate the users using Active Directory on the login page, before implementing Active Directory, we use ASP.NET membership to validate a user on the Login page. The code should look similar to the code below.</p>
<p><img decoding="async" class="wp-image-3568 size-full aligncenter" title="Code " src="https://development.ikf.in/metasys1/wp-content/uploads/2022/07/dotnet_2.png" alt="Code" width="431" height="28" /></p>
<p>Now, to create our own function to validate the user through Active Directory, we use the code below.</p>
<p><img decoding="async" class="wp-image-3569 size-full aligncenter" title="Code " src="https://development.ikf.in/metasys1/wp-content/uploads/2022/07/dotnet_3.png" alt="Code " width="450" height="33" /></p>
<p>VerifyUserAD accepts three parameters, namely, Username, Password and ReturnMsg. ReturnMsg returns the error message if the validation of the user fails against the Active Directory. Refer to the code below.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3570 size-full" title="Code" src="https://development.ikf.in/metasys1/wp-content/uploads/2022/07/dotnet_4.png" alt="Code" width="624" height="381" /></p>
<p>Once the user is validated, the function VertifyUserAD returns an ‘authenticated’ message, based on which the user can take the following relevant actions.</p>
<p>To entirely bypass the <a href="https://development.ikf.in/metasys1/case-study-dotnet/">ASP .NET</a> membership, use the Active Directory to validate the user. For an existing application, users can maintain and access a copy of Users in the database, meaning there is no need to modify the whole application end-to-end.</p>
<h2><strong>Role-based implementation</strong></h2>
<p>For role-based implementation, we use the DirectorySearcher class to fetch the property ‘memberOf’ for that user in Active Directory, as shown in the code below.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3572 size-full" title="Code" src="https://development.ikf.in/metasys1/wp-content/uploads/2022/07/dotnet_5.png" alt="Code " width="488" height="62" /></p>
<p>This enables users to find the list of Groups in which the user is assigned using the SearchResult.</p>
<p><img loading="lazy" decoding="async" class="aligncenter wp-image-3573 size-full" title="Search result " src="https://development.ikf.in/metasys1/wp-content/uploads/2022/07/dotnet_6.png" alt="Search result " width="416" height="76" /></p>
<p>Use the command below to install Directory Services using the package manager console.</p>
<p>Install-Package System.DirectoryServices</p>
<p>Hope this blog will help you in the implementation of Active Directory in Dot Net application. For more information on .Net services, please visit <a href="https://development.ikf.in/metasys1/dot-net">https://development.ikf.in/metasys1/dot-net</a></p>
</div>
</div>
</div>
</div>
</div>
</div>The post <a href="https://ikfstage.metasyssoftware.com/implementing-active-directory-in-a-net-application-with-multiple-roles/">Implementing Active Directory in a .NET application with Multiple Roles</a> appeared first on <a href="https://ikfstage.metasyssoftware.com">Metasys Software Pvt Ltd.</a>.]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
