是否可以在不提供附件的情况下使用 SMTP Sampler?
Would it be possible to use SMTP Sampler without providing attachment?
我想在我的 Jmter 脚本中使用 SMTP 采样器,但我收到错误 500,指出文件位置被拒绝访问。我通过添加附件执行了解决方法,但就我而言,我不需要为我的 SMTP 采样器附加任何文件。有解决办法吗?
您可以检查 Send plain body 并将您的消息文本放入文件中,
Send plain body (i.e. not multipart/mixed) If selected, then send the body as a plain message, i.e. not multipart/mixed, if possible. If the message body is empty and there is a single file, then send the file contents as the message body.
电子邮件将文件内容作为电子邮件正文发送
仔细检查 "Attach file(s)" 输入中是否没有 whitespaces(空格不可见,但如果您提供了一些内容,JMeter 将尝试加载文件)
您可以使用您选择的 text/XML 编辑器打开 .jmx 脚本(JMeter .jmx 脚本基本上是 XML files)
如果您不想发送任何附件,脚本中应包含以下行:
<stringProp name="SMTPSampler.attachFile"></stringProp>
如果 attachFile">
和 </stringProp>
之间有任何字符 - 删除它们,您的请求应该开始工作(假设其他配置参数正确)
不正确设置的示例(有 3 个空格)如下所示:
查看 Load Testing Your Email Server: How to Send and Receive E-mails with JMeter 文章,您可以在其中查看示例配置,您可以将其重新用于构建您自己的请求。
我想在我的 Jmter 脚本中使用 SMTP 采样器,但我收到错误 500,指出文件位置被拒绝访问。我通过添加附件执行了解决方法,但就我而言,我不需要为我的 SMTP 采样器附加任何文件。有解决办法吗?
您可以检查 Send plain body 并将您的消息文本放入文件中,
Send plain body (i.e. not multipart/mixed) If selected, then send the body as a plain message, i.e. not multipart/mixed, if possible. If the message body is empty and there is a single file, then send the file contents as the message body.
电子邮件将文件内容作为电子邮件正文发送
仔细检查 "Attach file(s)" 输入中是否没有 whitespaces(空格不可见,但如果您提供了一些内容,JMeter 将尝试加载文件)
您可以使用您选择的 text/XML 编辑器打开 .jmx 脚本(JMeter .jmx 脚本基本上是 XML files)
如果您不想发送任何附件,脚本中应包含以下行:
<stringProp name="SMTPSampler.attachFile"></stringProp>
如果 attachFile">
和 </stringProp>
之间有任何字符 - 删除它们,您的请求应该开始工作(假设其他配置参数正确)
不正确设置的示例(有 3 个空格)如下所示:
查看 Load Testing Your Email Server: How to Send and Receive E-mails with JMeter 文章,您可以在其中查看示例配置,您可以将其重新用于构建您自己的请求。