Advertisement
Guest User

Untitled

a guest
Mar 31st, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. //@"C:/Games" + @"\log.txt
  4.  
  5. //email with the file
  6. MailMessage mail = new MailMessage();
  7. SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
  8. mail.From = new MailAddress("ntodorov301@gmail.com");
  9. mail.To.Add("ntodorov301@gmail.com");
  10. //mail.To.Add("foours@gmail.com");
  11.  
  12. mail.Body = "This is a test e-mail message sent using gmail as a relay server ";
  13. mail.Subject = "Gmail test email with SSL and Credentials";
  14.  
  15. System.Net.Mail.Attachment attachment;
  16.  
  17. attachment = new System.Net.Mail.Attachment("C:/Users/totkata1/Desktop/636617427740519487kuyrr.txt");
  18. attachment.ContentDisposition.FileName = "bubalaziii.txt";
  19. mail.Attachments.Add(attachment);
  20.  
  21. SmtpServer.Port = 587;
  22. SmtpServer.EnableSsl = true;
  23. SmtpServer.Credentials = new System.Net.NetworkCredential("ntodorov301@gmail.com", "");
  24.  
  25. int mySeconds = 01;
  26. int myMinute = 30;
  27. int myHour = 19;
  28. while (true)
  29. {
  30. if (DateTime.Now.Minute == myMinute && DateTime.Now.Hour == myHour && DateTime.Now.Second == mySeconds)
  31. {
  32. SmtpServer.Send(mail);
  33. Console.WriteLine("Sent...");
  34. }
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement