C# Static types cannot be used as parameters

asp.netc++statictypes

public static void SendEmail(String from, String To, String Subject, String HTML, String AttachmentPath = null, String AttachmentName = null, MediaTypeNames AttachmentType = null)
{
    ....

    // Add an attachment if required
    if (AttachmentPath != null)
    {
        var ct = new ContentType(MediaTypeNames.Text.Plain);
        using (var a = new Attachment(AttachmentPath, ct)
                    {
                        Name = AttachmentName,
                        NameEncoding = Encoding.UTF8,
                        TransferEncoding = TransferEncoding.Base64
                    })
        {
            mailMessage.Attachments.Add(a);
        }
    }

    ....
}

As you can see the MediaTypeNames AttachmentType throws the error:

'System.Net.Mime.MediaTypeNames': static types cannot be used as parameters

What is the best way to deal with this?

Best Solution

You can't pass a static type to a method as a parameter because then it would have to be instantiated, and you can't create an instance of a static class.