hola todos
Estoy adjuntando un documento que convierto en memorystrem. El problema que cuando me llega el adjunto me llega con un peso de 0 bits,
¿Como puedo resolver esto?
Este es el codigo que tengo
Código ASP:
Ver originalIf archivoAdjunto.Trim <> "" Then
'Using memoryStream As New MemoryStream()
Dim memoryStream As New MemoryStream()
Dim contentAsBytes As Byte() = Encoding.UTF8.GetBytes(archivoAdjunto)
MemoryStream.Write(contentAsBytes, 0, contentAsBytes.Length)
' Set the position to the beginning of the stream.
'memoryStream.Seek(0, SeekOrigin.Begin)
' Create attachment
Dim contentType As New System.Net.Mime.ContentType
contentType.Name = archivoAdjunto.Substring(archivoAdjunto.LastIndexOf("\") + 1)
contentType.MediaType = "application/pdf"
' Add the attachment
Mensaje.Attachments.Add(New Attachment(memoryStream, contentType))
'End Using
End If
'Asignar el servidor de correo electronico
'SmtpMail.SmtpServer = "localhost"
SmtpMail.Host = "**********.********.corp"
'Finalmente, enviar el mensaje.
Try
SmtpMail.Send(Mensaje)
Asi es como llega al correo:
Me da este error al intentarlo abrir
Agradecere ayuda,