Advertisement
Guest User

Untitled

a guest
Jun 24th, 2015
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. string message ="my255CharText";
  2. using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"\shareddatatempbuoy.txt"))
  3. {
  4. file.WriteLine(message);
  5. }
  6. MailMessage emailMsg = new MailMessage();
  7. emailMsg.To.Add("email@destination.com);
  8. emailMsg.Subject = "my Subject";
  9. emailMsg.From = new MailAddress("email@source.com");
  10. emailMsg.BodyEncoding = System.Text.Encoding.ASCII;
  11. emailMsg.IsBodyHtml = false;
  12.  
  13. Attachment data = new Attachment(@"\shareddatatempbuoy.txt", MediaTypeNames.Text.Plain);
  14.  
  15. emailMsg.Attachments.Add(data);
  16. ContentDisposition dispositon = data.ContentDisposition;
  17. dispositon.Inline=true;
  18. SmtpClient smtp = new SmtpClient("SMTP_SERVER");
  19. smtp.Send(emailMsg);
  20.  
  21. Attachment data = new Attachment(message, MediaTypeNames.Text.Plain);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement