현재 WinForms 앱에서 간단한 이메일을 보내려면 Process.Start를 사용하고 있습니다. 전자 메일에 첨부 파일을 추가하는 방법을 생각해보십시오. (? 편집 : Process.Start를 사용) ->WinForms 앱에서 첨부 파일이있는 전자 메일을 보내시겠습니까?
MailMessage theMailMessage = new MailMessage("[email protected]", "[email protected]");
theMailMessage.Body = "body email message here";
theMailMessage.Attachments.Add(new Attachment("pathToEmailAttachment"));
theMailMessage.Subject = "Subject here";
SmtpClient theClient = new SmtpClient("IP.Address.Of.Smtp");
theClient.UseDefaultCredentials = false;
System.Net.NetworkCredential theCredential = new System.Net.NetworkCredential("[email protected]", "password");
theClient.Credentials = theCredential;
theClient.Send(theMailMessage);
좋아을, 당신의 편집 및 기반으로
Process.Start("mailto:[email protected]?subject=" + HttpUtility.HtmlAttributeEncode("Application error report") + "&body=" + body);
유사 포스트 -> http://stackoverflow.com/questions/1195111/c-mailto-with-attachment 물어 깜빡 –