Ask a Question

Getting Content from an Email

Occasional Contributor

Getting Content from an Email

Hey Community


I want to read a generated code in an email sent by one of the API's that we are currently testing in Ready API 3.0.  

Is there a way to take the content of the email so that we can extract the code to pass to another API Call?


Any Help is Appreciated.



Super Contributor

Can you show an example for that "generated code in an email sent by one of the API's"? How the content looks like? Its in xml/json format.. Just explain.


Just expanding avidCoder's query.

Are you saying you send a request to an endpoint and a response comes back and the payload of the response is an email (say .html type so the content can be read by an xmlparser) or are you saying that an email is sent out to a specific mailbox and the content of the email includes a value you need to correlate?

Reason i ask is that if you just get a response with a payload as an email then thats workable (even if worst case the content type is just text/plain), but if theres some email generator that sends an email to a specific mailbox i think youre going to struggle to incorporate ReadyAPI! into your testing.

Need to know more details about your use case to gain a clear understanding of what you need to do before we can try and help out fella.
Dedinitely need to know the datatypeof the response payload for the email which is revealed in the http headers

Nice one!

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
SmartBear Alumni (Retired)

Thank you guys! 


Hi @cpentecost, please provide the Community with more info as required so we can help you! 

Sonya Mihaljova
Community and Education Specialist

Occasional Contributor

Sorry for the Late Reply.

So the Code we are looking to get Comes in a Generated Email sent to a predetermined inbox.  

We send a msg for a verification code from a third party and then that code is emailed to the predetermined inbox.

we sort of figured that this may not verifiable through ReadyAPI but we figured we would ask the question.


Let us know your thoughts,



SmartBear Alumni (Retired)

Hi @cpentecost,


There is no special feature for reading content of email messages in ReadyAPI, but, you can try to do this using groovy scripting.

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Showing results for 
Search instead for 
Did you mean: