当前位置: 首页>>代码示例>>C#>>正文


C# MimeMessage.Accept方法代码示例

本文整理汇总了C#中MimeKit.MimeMessage.Accept方法的典型用法代码示例。如果您正苦于以下问题:C# MimeMessage.Accept方法的具体用法?C# MimeMessage.Accept怎么用?C# MimeMessage.Accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MimeKit.MimeMessage的用法示例。


在下文中一共展示了MimeMessage.Accept方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Detect

        /// <summary>
        /// detects whether a message is a standard bounce message.
        /// </summary>
        ///
        /// essentially this finds the `multipart/report; report-type=delivery-status` part and
        /// its `message/delivery-status` sub-part to decide whether a message is a bounce.
        ///
        /// the message/delivery-status mime part looks something like:
        ///
        ///      Content-Type: message/delivery-status
        ///
        ///      Reporting-MTA: dns; PTPEDGE02.test.local
        ///
        ///      Final-recipient: RFC822;
        ///       [email protected]
        ///      Action: failed
        ///      Status: 5.1.1
        ///      Remote-MTA: dns; mx.google.com
        ///      X-Supplementary-Info: &lt;mx.google.com #5.1.1 smtp;550-5.1.1 The email account
        ///       that you tried to reach does not exist.Please try 550-5.1.1 double-checking
        ///      the recipient's email address for typos or 550-5.1.1 unnecessary spaces.
        ///       Learn more at 550 5.1.1  https://support.google.com/mail/answer/6596
        ///       om11si19081667wic.29 - gsmtp>
        ///
        /// See the multipart/report format RFC:
        ///      The Multipart/Report Media Type for the Reporting of Mail System Administrative Messages
        ///      https://tools.ietf.org/html/rfc6522
        /// See the message/delivery-status RFC:
        ///      An Extensible Message Format for Delivery Status Notifications
        ///      https://tools.ietf.org/html/rfc3464
        public static BounceDetectResult Detect(MimeMessage message)
        {
            var visitor = new Visitor();

            message.Accept(visitor);

            var result = visitor.Result;

            return new BounceDetectResult(
                message,
                result.DeliveryNotificationPart,
                result.DeliveryStatus,
                result.UndeliveredMessagePart
            );
        }
开发者ID:rgl,项目名称:MailBounceDetector,代码行数:45,代码来源:StandardBounceDetector.cs

示例2: CreateFile

        public string CreateFile(MimeMessage mailMessageEx)
        {
            if (mailMessageEx == null) throw new ArgumentNullException(nameof(mailMessageEx));

            var tempDir = CreateUniqueTempDirectory();
            var visitor = new HtmlPreviewVisitor(tempDir);
            mailMessageEx.Accept(visitor);

            string htmlFile = Path.Combine(tempDir, "index.html");

            _logger.Verbose("Writing HTML Preview file {HtmlFile}", htmlFile);

            File.WriteAllText(htmlFile, visitor.HtmlBody, Encoding.Unicode);

            return htmlFile;
        }
开发者ID:priestd09,项目名称:Papercut,代码行数:16,代码来源:HtmlPreviewService.cs

示例3: Visit

		/// <summary>
		/// Dispatches the message to one of the more specialized visit methods in this class.
		/// </summary>
		/// <remarks>
		/// Dispatches the message to one of the more specialized visit methods in this class.
		/// </remarks>
		/// <param name="message">The MIME message.</param>
		public virtual void Visit (MimeMessage message)
		{
			if (message != null)
				message.Accept (this);
		}
开发者ID:cybercircuits,项目名称:MimeKit,代码行数:12,代码来源:MimeVisitor.cs

示例4: Render

		void Render (MimeMessage message)
		{
			var tmpDir = Path.Combine (Path.GetTempPath (), message.MessageId);
			var visitor = new HtmlPreviewVisitor (tmpDir);

			Directory.CreateDirectory (tmpDir);

			message.Accept (visitor);

			DisplayHtml (visitor.HtmlBody);
			DisplayAttachments (visitor.Attachments);
		}
开发者ID:Gekctek,项目名称:MailKit,代码行数:12,代码来源:MimeVisitorExamples.cs

示例5: Render

		void Render (WebBrowser browser, MimeMessage message)
		{
			var tmpDir = Path.Combine (Path.GetTempPath (), message.MessageId);
			var visitor = new HtmlPreviewVisitor (tmpDir);

			Directory.CreateDirectory (tmpDir);

			message.Accept (visitor);

			browser.DocumentText = visitor.HtmlBody;
		}
开发者ID:naeemkhedarun,项目名称:MailKit,代码行数:11,代码来源:MimeVisitorExamples.cs


注:本文中的MimeKit.MimeMessage.Accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。