Beispiel #1
0
		public void BodyBase64()
        { 
            var messageData = new SmtpMessageData { FromAddress = new MailAddress("*****@*****.**") };
            messageData.AddData(TestBodyBase64);
            var message = messageData.ParseMessage();

            message.Attachments.Count.ShouldEqual(1);
            new BinaryReader(message.Attachments[0].ContentStream).ReadBytes((int)message.Attachments[0].ContentStream.Length).ShouldEqual(Attachment1BodyData);
            message.Attachments[0].ContentType.MediaType.ShouldEqual("application/pdf");
            message.Attachments[0].ContentDisposition.DispositionType.ShouldEqual("attachment");
            message.Attachments[0].Name.ShouldEqual("000000002.pdf");
		}		
Beispiel #2
0
		public void MessageHeaders()
		{
            var messageData = new SmtpMessageData { FromAddress = new MailAddress("*****@*****.**") };
			messageData.AddData(TestSingleBase64);
		    var message = messageData.ParseMessage();

            message.Headers["Received"].ShouldEqual("from development02 (development02 [127.0.0.1]) by adexs.com (Eric Daugherty's C# Email Server) 4/16/2004 10:35:58 AM");
            message.Headers["From"].ShouldEqual("\"Eric Daugherty\" <*****@*****.**>");
            message.Subject.ShouldEqual("CofAs");
            message.Headers["Date"].ShouldEqual("Fri, 16 Apr 2004 10:35:55 -0500");
            message.Headers["X-MimeOLE"].ShouldEqual("Produced By Microsoft MimeOLE V6.00.2800.1409");
		}