SmtpClient class, SmtpClient
SmtpClient class
Allow applications to send emails using Simple Mail Transfer Protocol (SMTP.
Namespace: System.net. mail
Attribute
ClientCertificates: Specifies the certificate to use to establish a Secure Socket Layer (
SmtpClient class
Allows an application to send e-mail messages using the Simple Mail Transfer Protocol (SMTP).
Namespaces: System.Net.Mail
Property
ClientCertificates: Specifies which certificate should be used to establish a Secure Sockets Layer
The mail sending function is used in a recent project. This is different from the method used to send emails for a previous project. Previously, information about the emails to be sent was inserted into a database table on the server. The database
. Net has greatly improved the mail. smtpclient function since 2.0. It is easy to send emails. However, the US lacks the ability to save the email content as an EML file.
In fact, smtpclient and mailmessage have implemented this function, but this
Objective There are many ways to send mail, such as sending mail via the. Net Framework's built-in SmtpClient, using an open source project Lumisoft.net, and so on, and here's how to use SmtpClient under the System.Net.Mail namespace to send mail.
Use the smtpclient class to send simple text emails, but cannot send emails containing attachments.To a receiver, it is a built-in JDK package, so it is more universal.The javamail package provides excellent functions to write any powerful
ASP. NET series: SmtpClient and asp. netsmtpclient for unit testing
When SmtpClient is used to send an Email, we can create an ISmtpClient interface and a SmtpClientWrapper adaptation class. In the unit test, we can perform Mock or custom
For the first time, I used this method to send an email. For example, I used my live mailbox to send an email to my QQ mailbox.
The steps for sending an email using smtpclient will not be discussed. You can find too many information on the Internet.
Code 1: using system; using system. data; using system. web. ui; using system. data. oracleclient; using dbutility; using system. text. regularexpressions; using system. net; using system. net. mail; using system. XML; using system. net. mime; using
When sending email using smtpclient, we can create ismtpclient interfaces and Smtpclientwrapper adaptation classes, mock or custom fackesmtpclient ismtpclient in unit tests, But Ndumbster's Facke SMTP Server provides us with a more intuitive and
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.