C# Program to Check Whether a Given URI Is Accessed Through Smtp Protocol

You are currently viewing C# Program to Check Whether a Given URI Is Accessed Through Smtp Protocol

C# program to check whether a given Uri is accessed through SMTP protocol

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        Uri uriAddress = new Uri("mailto:[email protected]");

        Console.WriteLine(uriAddress.Scheme);
        Console.WriteLine(Uri.UriSchemeMailto);

        if (uriAddress.Scheme == Uri.UriSchemeMailto)
            Console.WriteLine("Given Uri is access through SMTP protocol");
    }
}
mailto
mailto
Given Uri is access through SMTP protocol
Press any key to continue . . .

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply