0
votes

I would like to use SMTP Sampler in my Jmter script but i am getting error 500 saying that a file location is access denied. I performed workaround by adding attachment but in my case, I do not need to attach any files for my SMTP sampler. Are there any workaround for this?

2

2 Answers

0
votes

Double check that there is no whitespaces in the "Attach file(s)" input (the whitespaces are not visible but given you provide something there JMeter will try to load the file)

You can open your .jmx script with a text/XML editor of your choice (JMeter .jmx scripts are basically XML files)

If you don't want to send any attachments there should be the following line in the script:

<stringProp name="SMTPSampler.attachFile"></stringProp>

if there are any characters between attachFile"> and </stringProp> - remove them and your request should start working (assuming that other configuration parameters are correct)

An example of incorrect setup (with 3 whitespaces) will look like:

enter image description here

Check out Load Testing Your Email Server: How to Send and Receive E-mails with JMeter article where you can see example configuration which you can re-use for building your own request.

0
votes

You can check Send plain body and put your message text inside the file,

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.

Email will send file content as email body