附件仅联机提供



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

        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);

我做错了什么?

我只在macMail中测试过,现在我在gmail中尝试过,附件表示很好,而不是在行中

相关内容

  • 没有找到相关文章

最新更新