Witam. Czy dałoby się napisać tak żeby pobrało źródło że strony z http://dynupdate.no-ip.com/ip.php i wysłanie go na email. Oto kod:
WebClient wc = new WebClient();
wc.DownloadFile("http://dynupdate.no-ip.com/ip.php", @"D:\ZapiszPlik.txt");
var message = new MailMessage();
message.From = new MailAddress("mojemail@o2.pl", "mojemail@o2.pl");
message.To.Add(new MailAddress("emailodbiorcy"));
message.Subject = "Temat";
message.Body = "Treść";
Attachment attach = new Attachment("D:/WyslijPlik.txt");
message.Attachments.Add(attach);
var smtp = new SmtpClient("poczta.o2.pl");
smtp.UseDefaultCredentials = false;
smtp.Credentials = new NetworkCredential("mojemail@o2.pl", "mojehaslo");
smtp.EnableSsl = true;
smtp.Port = 587;
smtp.Send(message);