I am new to jmeter and trying to send an email using SMTP.

Here is my sampler:

enter image description here

this is the error results:

Thread Name: REST example 1-3
Sample Start: 2018-01-15 14:34:54 CET
Load time: 21003
Connect Time: 0
Latency: 0
Size in bytes: 173
Sent bytes:0
Headers size in bytes: 0
Body size in bytes: 173
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 500
Response message: Could not connect to SMTP host: smtp.gmail.com, port: 587

Response headers:

SampleResult fields:
DataEncoding: null

Please how to fix it?



First of all try connecting to test connectivity to smtp.gmail.com:587 using telnet tool or equivalent. If you cannot - it might be the case you're behind the corporate firewall and you'll need to "tell" JMeter to use your corporate proxy.

For HTTP add the next lines to system.properties file:


for SMTP set the following property:


You can also pass them to JMeter startup script via -D command-line argument like:

jmeter -DsocksProxyHost=your_proxy_host

See Apache JMeter Properties Customization Guide article to learn more about JMeter properties and ways of setting and overriding them.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.