SmtpMail::Send Method (MailMessage^)
.NET Framework (current version)
Sends an e-mail message using arguments supplied in the properties of the MailMessage class. Recommended alternative: System.Net.Mail.
Assembly: System.Web (in System.Web.dll)
public: [AspNetHostingPermissionAttribute(SecurityAction::Demand, Level = AspNetHostingPermissionLevel::Medium)] [SecurityPermissionAttribute(SecurityAction::Assert, UnmanagedCode = true)] static void Send( MailMessage^ message )
Parameters
- message
-
Type:
System.Web.Mail::MailMessage^
The MailMessage to send.
| Exception | Condition |
|---|---|
| COMException | The mail cannot be sent. |
| PlatformNotSupportedException | The Send method requires the Microsoft Windows NT, Windows 2000, or Windows XP operating system. |
The following example shows how to use MailMessage to send an e-mail message using SmtpMail.
.NET Framework
Available since 1.1
Available since 1.1
Show: