DD.WellWorkover.Cloud/ConsoleApp1/SendMail.cs

31 lines
964 B
C#
Raw Normal View History

2022-01-17 17:55:00 +05:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
public static class SendMail
{
public static void Main()
{
MailAddress to = new MailAddress("ng.frolov@autodrilling.ru");
MailAddress from = new MailAddress("bot@autodrilling.ru");
MailMessage message = new MailMessage(from, to);
2022-02-28 14:44:26 +05:00
2022-01-17 17:55:00 +05:00
message.Subject = "Using the new SMTP client.";
message.Body = "<html><boby><H1>this is a test text</H1></boby></html>";
message.IsBodyHtml = true;
SmtpClient client = new SmtpClient("smtp.timeweb.ru");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential("bot@autodrilling.ru", "xHhgwZ4D");
client.Send(message);
}
}
}