I wonder if its because of the way you add the attachment without specifying the content-type - I did a quick look but the docco is 'bleh'
you could try this (strung together, may need a bit of poking into shape) :-
System.Net.Mime.ContentType ct = new System.Net.Mime.ContentType(System.Net.Mime.MediaTypeNames.Application.Pdf);
System.Net.Mail.Attachment attach = new System.Net.Mail.Attachment(memoryStream, ct);
attach.ContentDisposition.FileName = invoicename + ".pdf";
mail.Attachments.Add(attach);
or maybe this
mail.Attachments.Add(new Attachment(memorystream, invoicename+".pdf", "application/pdf"));
(I'd check if "application/pdf" was legal before using it)