發表文章

目前顯示的是 6月, 2021的文章

.net core C# SMTP gmail

   [HttpGet]         public IActionResult Get()         {             string to = "carlosauyeung306@gmail.com";             string from = "carlosauyeung306@gmail.com";             string subject = "Using the new SMTP client.";             string body = @"Using this new feature, you can send an email message from an application very easily.";             MailAddress fromAddress = new MailAddress(from);             MailAddress toAddress = new MailAddress(to);             MailMessage mail = new MailMessage(fromAddress.Address, toAddress.Address);             mail.Subject = "Testing";             mail.Body = "contents.";             SmtpClient cli...