Joke Collection Website - Blessing messages - . Network short message
. Network short message
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.
- Previous article:How to turn off *** sharing and phone number on Apple phone?
- Next article:Where is the SMS permission of Xiaomi Tablet?
- Related articles
- Reporting phone number and instructions for Fangzhouyuan Community, Wangjing Street, Beijing
- The wedding has been held and guests have been invited. How to write the invitation?
- What if the sim card keeps harassing text messages?
- PICC sent a text message asking for repayment three days later, and now it is 10 day. It hasn't arrived yet, and the person in charge can't get through. It's really annoying
- Why can't the gas station call?
- If someone confesses to you, how should you reply?
- How to send double twelve short messages?
- The circle of friends sent a text message to the court to inform that they were cheated.
- Vivox5 picture SMS cannot be downloaded.
- What card should I use to send a message by phone?