Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Email Attachment Size Limit
- MailMessage mail = new MailMessage();
- SmtpClient SmtpServer = new SmtpClient("smtp.live.com");
- mail.From = new MailAddress("email@hotmail.co.uk");
- mail.To.Add("receiving@hotmail.co.uk");
- mail.Subject = "Emailed from C#";
- mail.Body = "Emailed with attachment";
- Attachment attachment;
- attachment = new Attachment(@"C:file.txt");
- mail.Attachments.Add(attachment);
- SmtpServer.Port = 587;
- SmtpServer.Credentials = new NetworkCredential("email@hotmail.co.uk", "password");
- SmtpServer.EnableSsl = true;
- SmtpServer.Send(mail);
Add Comment
Please, Sign In to add comment