本文介绍了.NET MailMessage类注入安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道课程受的保护。例如,我应该在将值传递给其构造函数之前检查值:

I wonder if MailMessage class is protected from e-mail injection. For example, should I check values before passing them to its constructor:

MailMessage message = new MailMessage(fromTextBox.Text, toTextBox.Text);


推荐答案

MailAddress class根据RFC822的完整BNF语法检查其地址。 (请参阅 MailBnfHelper )。

The MailAddress class checks its addresses against the full BNF grammar from RFC822. (See MailBnfHelper).

使用 MailMessage 秒。 (除了您自己的内容中的HTML注入外)

There is no risk of injection when using MailMessages. (Except HTML injection in your own content)

这篇关于.NET MailMessage类注入安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 14:40