2009-05-15 2 views

답변

0

차트 데이터를 저장하고 데이터를로드 할 페이지에 대한 링크를 만들거나 페이지를 만든 HTML을 가져 와서 전자 메일에로드 할 수 있습니다. 모든 사용자가 HTML을 보는 것은 전자 메일이 아니므로 데이터를 차트로 표시 할 수있는 페이지에 대한 링크를 보내는 것이 더 안전 할 수 있습니다.

2

차트 구성 요소는 차트가 요청 될 때 실제로 이미지를 생성합니다. 그런 다음이 이미지를 파일 시스템에 저장하거나 단순히 메모리에 저장합니다. 그 부분은 구성 가능합니다.

차트를 생성 한 다음 차트에서 파일 참조를 가져올 수 있습니다. 거기에서 두 가지 선택이 있습니다. 귀하의 전자 메일을 URL 참조로 참조하거나 실제 전자 메일 내에 포함 시키십시오. 또한 메일 클라이언트가 구성 할 수 있습니다. 다음과 같이

2

당신은 어딘가에 이미지를 저장하고로드하고 메일에 포함 된 수 :

 private void SendMail() 
     { 
      //Your mail body is created with help of a StringBuilder which will contain the img tag: 
      //Suppose the mailContent is the StringBuilder object and has the html body etc already appended.... 
      //you would need to append something like following: 

      //mailContent.Append("<td><img src=\"cid:IMAGE_ID\"></td>"); 
      //string body = mailContent.ToString(); 


      string smtpServer = "mailhost.my.domain.net"; 
      string emailFrom = "[email protected]"; 
      string emailTo = "[email protected]"; 


      MailMessage msg = new MailMessage(emailFrom, emailTo, "TestMail...", body); 

      msg.IsBodyHtml = true; 

      //Adding attachments by loading from file 
      Attachment item = new Attachment("Images/Logo.JPG"); 
      item.ContentDisposition.Inline = true; 
      item.ContentDisposition.DispositionType = DispositionTypeNames.Inline; 
      item.ContentId = "IMAGE_ID"; 
      item.ContentType.MediaType = "image/jpeg"; 
      item.ContentType.Name = "Logo.JPG"; 

      msg.Attachments.Add(item); 

      SmtpClient client = new SmtpClient(smtpServer); 
      client.Send(msg); 

     } 
관련 문제