MailMessage Constructor (MailAddress, MailAddress)
.NET Framework (current version)
Initializes a new instance of the MailMessage class by using the specified MailAddress class objects.
Assembly: System (in System.dll)
Parameters
- from
-
Type:
System.Net.Mail.MailAddress
A MailAddress that contains the address of the sender of the e-mail message.
- to
-
Type:
System.Net.Mail.MailAddress
A MailAddress that contains the address of the recipient of the e-mail message.
| Exception | Condition |
|---|---|
| ArgumentNullException | from is null. -or- to is null. |
| FormatException | from or to is malformed. |
.NET Framework
Available since 2.0
Available since 2.0
Show: