Today, I sent a mail to the mailbox smtpclient. The MailServer on the shelf is normal, but the MailServer on the other side is lost. It is found that the mailbox certificate appears, but the Outlook mail is normal, if no result is found, use the
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
The procedure is this:
Copy Code code as follows:
static void Main (string[] args)
{
SmtpClient client = new SmtpClient ();
Client. Host = "localhost";
MailAddress from = new MailAddress ("from@test.com");
MailAddress
ProgramYes:
CopyCode The Code is as follows: static void main (string [] ARGs)
{
Smtpclient client = new smtpclient ();
Client. Host = "localhost ";
Mailaddress from = new mailaddress ("from@test.com ");Mailaddress to = new mailaddress ("to@
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
Asp.net three email sending codes (stmp, no component email sending)
Asp tutorial. net three email sending code (stmp, no component email sending)
Public bool sendmails (){Smtpclient _ smtpclient = new smtpclient ();_ Smtpclient. deliverymethod =
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.