SoFunction
Updated on 2025-03-06

C# Email Send emails. The other party opens the email and gets a reminder

This article has shared the specific code of emails sent by C# Email for your reference. The specific content is as follows

//Receipt address   var Receipt = "Fill in the address you need to receive a receipt";

   //Instantiate two necessary   MailMessage mail = new MailMessage();
   SmtpClient smtp = new SmtpClient();

   //Send email address    = new MailAddress("Send email address");

   //Recipient (can send it in bulk)   (new MailAddress("1402173344@"));

   // Whether to send in HTML format    = true;
   //Theme encoding format    = Encoding.UTF8;
   //The title of the email    = "Test the title of the sender";
   //Content encoding format    = Encoding.UTF8;
   //Priority of email    = ;
   //Send content with a picture tag, which is used to send back the address information you filled in after the other party opens it.    = @"Get the user who opened the emailIP,Images are automatically generated by the server:<img src='" + Receipt + "'>";
   //The recipient can be in the email   ("Disposition-Notification-To", "Receipt Information");

   //The server address of the sending email    = "smtp.";
    = ;
    = 1000000;
   //Is it SSL encryption    = true;
   //Set the port. If not set, the default port is 25    = 25;
    = false;
   //Verify the sender's credentials    = new ("Email Account", "Email Credentials");

   try
   {
    //Send email    (mail);
    ("Send successfully");
   }
   catch (Exception e)
   {
    ("Send failed:" + );
   }

The above is all the content of this article. I hope it will be helpful to everyone's study and I hope everyone will support me more.