Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- //@"C:/Games" + @"\log.txt
- //email with the file
- MailMessage mail = new MailMessage();
- SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
- mail.From = new MailAddress("ntodorov301@gmail.com");
- mail.To.Add("ntodorov301@gmail.com");
- //mail.To.Add("foours@gmail.com");
- mail.Body = "This is a test e-mail message sent using gmail as a relay server ";
- mail.Subject = "Gmail test email with SSL and Credentials";
- System.Net.Mail.Attachment attachment;
- attachment = new System.Net.Mail.Attachment("C:/Users/totkata1/Desktop/636617427740519487kuyrr.txt");
- attachment.ContentDisposition.FileName = "bubalaziii.txt";
- mail.Attachments.Add(attachment);
- SmtpServer.Port = 587;
- SmtpServer.EnableSsl = true;
- SmtpServer.Credentials = new System.Net.NetworkCredential("ntodorov301@gmail.com", "");
- int mySeconds = 01;
- int myMinute = 30;
- int myHour = 19;
- while (true)
- {
- if (DateTime.Now.Minute == myMinute && DateTime.Now.Hour == myHour && DateTime.Now.Second == mySeconds)
- {
- SmtpServer.Send(mail);
- Console.WriteLine("Sent...");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement