0
votes

I am using the Mail Reader Sampler to read the email from Gmail and get a token Id from the email which is required for our further testing. But all the time I am getting the below error:

Response code: 500 Response message: javax.mail.MessagingException: Connection timed out: connect; nested exception is: java.net.ConnectException: Connection timed out: connect imaps://[email protected]@imap.googlemail.com/INBOX[5]

Response headers:

SampleResult fields:
ContentType: 
DataEncoding: null

Can someone help?

1
This may help someone else as well: stackoverflow.com/a/39215365/1306012Bruno Bieri

1 Answers

1
votes

I assume you have enabled IMAP in Gmail settings?

Using Gmail might be not a very good idea as it has i.e. limits on simultaneous connections and if you checking your mailbox in multithreaded manner you might be blocked.

Check whether you can receive email using POP3 protocol and the following configuration:

  • Protocol: pop3s
  • Server Host: pop.googlemail.com
  • Server Port: 995
  • Username: [email protected]
  • Password: your_password
  • Number of messages to retrieve: I believe it should be 1
  • Security settings: Use SSL

See Load Testing Your Email Server: How to Send and Receive E-mails with JMeter for settings explained.

And if not - consider setting up your own mail server (better somewhere in your company intranet) so you could have full control of it and won't suffer from any form of limits or security constraints.