附件只是内联的

时间:2014-10-21 14:06:17

标签: c# email attachment email-attachments

我将一个文件附加到电子邮件中,并将其设置为附件,但它只是内联

        Attachment data = new Attachment(filepath);
        data.ContentDisposition.Inline = false;
        data.ContentDisposition.DispositionType = DispositionTypeNames.Attachment;

        // Add time stamp information for the file.
        ContentDisposition disposition = data.ContentDisposition;
        disposition.CreationDate = System.IO.File.GetCreationTime(filepath);
        disposition.ModificationDate = System.IO.File.GetLastWriteTime(filepath);
        disposition.ReadDate = System.IO.File.GetLastAccessTime(filepath);
        disposition.FileName = filename;
        disposition.DispositionType = DispositionTypeNames.Attachment;


        // Add the file attachment to this e-mail message.
        message.Attachments.Add(data);

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我只在mac Mail中测试过,现在我尝试使用gmail和附件表示没问题,不在线