Joke Collection Website - Blessing messages - . Network short message

. Network short message

This needs to be paid and free. At present, there is a simple and free way, that is, you can use the mail arrival notification function of mobile 139 mailbox to notify your mobile phone. It seems that other e-mail providers have started to offer this service now. Specifically, you need to download the website information of all email providers.

The question now is how to send an email to your mailbox when there is a page error.

I will give you a box below, and then I will make my own account information.

Public bool SendMail (string addition, string theme, string content)

{

attempt

{

SMTP client c = new SMTP client(“SMTP . 139 . com“,23); //Here you need to change the SMTP server address of your email server and the email port of the server, which can be found on the website.

c.credentials = new network credential(“test 00 1“,“password 00 1“); //Enter the sender's account number and password here.

//Define the message

mail message mail message = new mail message();

Mail message. From = new email address ("xxxx @139.com"); //Your 139 email address

Mail message. To.Add; //Here, change to the email address where you want to receive the error, and call this code when there is a system error.

Mail message. Subject = topic; //"System error reminder";

Mail message. Body = content; //"There is an error in the system for the following reasons:";

Mail message. Priority = mail priority. High;

Mail message. IsBodyHtml = true

Mail message. BodyEncoding = encoding. UTF8

//Send

C. send (mail);

Mail message. dispose();

Return true

}

Catch (anomaly)

{

Returns false

}

}

In addition, the following namespaces need to be introduced

Use the system. Mail;

Use System.Net;

//Call example

Sendmail ("xxxx @139.com", "System error reminder", "Fill in the error reason here." ); Here, change it to your own as needed. The first is to receive the wrong email address, the second is the title, and the third is the content.