System.Net.Mail.MailMessage.MailMessage C# (CSharp) Method

MailMessage() public method

public MailMessage ( string from, string to ) : System
from string
to string
return System
        public MailMessage(string from, string to)
        {
            if (from == null)
                throw new ArgumentNullException(nameof(from));

            if (to == null)
                throw new ArgumentNullException(nameof(to));

            if (from == string.Empty)
                throw new ArgumentException(SR.Format(SR.net_emptystringcall, nameof(from)), nameof(from));

            if (to == string.Empty)
                throw new ArgumentException(SR.Format(SR.net_emptystringcall, nameof(to)), nameof(to));

            _message = new Message(from, to);
            if (NetEventSource.IsEnabled) NetEventSource.Associate(this, _message);
        }

Same methods

MailMessage::MailMessage ( ) : System
MailMessage::MailMessage ( System.Net.Mail.MailAddress from, System.Net.Mail.MailAddress to ) : System
MailMessage::MailMessage ( string from, string to, string subject, string body ) : System