Renu
Renu

Reputation: 91

Error shows while using SMTP sampler in jmeter

I have tried using SMTP sampler with the following details,

  1. server: smtp.googlemail.com
  2. port: 587
  3. Address from: gmail account
  4. Address to: gmail account
  5. checked Use Auth check box and the required username and password of the from
    gmail account is given with the subject and message body.

But I'm facing the below sampler result,

Response code: 500 Response message: Other MessagingException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.googlemail.com, port: 587; nested exception is: java.net.ConnectException: Connection refused: connect

Can anyone please help me on this?

Upvotes: 1

Views: 1088

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

You can confirm JMeter network connectivity by adding i.e. HTTP Request sampler and opening a website which definitely exists, i.e. http://example.com

If you get the same "Connection refused" message - most probably you are sitting behind the corporate firewall and you will need to apply some extra configuration so JMeter would use your corporate proxy like:

jmeter -H my.proxy.server -P 8000 -u username -a password

See Using JMeter behind a proxy guide for more information.

If you can send requests to Internet web sites and services successfully - double-check your SMTP Sampler configuration, maybe your config is missing an important setting, i.e. Use StartTLS

JMeter SMTP Sampler

Refer Load Testing Your Email Server: How to Send and Receive E-mails with JMeter article for comprehensive explanation and example configurations.

Upvotes: 1

Related Questions