예제 #1
0
        private Attachment RetornaAnexo(Anexo anexo)
        {
            if (anexo.stream == null)
            {
                throw new NullReferenceException("stream do anexo não disponivel!");
            }

            var att = new Attachment(anexo.stream, anexo.fileName, anexo.type);

            att.ContentDisposition.Inline          = false;
            att.ContentDisposition.DispositionType = DispositionTypeNames.Attachment;
            att.TransferEncoding = TransferEncoding.Base64;

            return(att);
        }
예제 #2
0
 /// <summary>
 /// Adiciona um anexo ao email
 /// </summary>
 /// <param name="anexo"></param>
 public void AdicionarAnexo(Anexo anexo)
 {
     this.anexos.Add(anexo);
 }