Pindub_Amateur
Pindub_Amateur

Reputation: 328

Receiving emails in Ruby

I'm working with actionmailer. I'm trying to send a mail from email_idA to email_idB, then fetch that email from email_idB, and do some string operations on it to look for specific keywords.

I understood how to send the email. But how do I receive that email from email_idB's inbox? What configurations do I need to do? And how do I extract the email body as plain text?

Upvotes: 0

Views: 1012

Answers (1)

Pramod Solanky
Pramod Solanky

Reputation: 1690

Did you mean fetch or receive ? Your question uses both these terms and not sure what you mean.

  1. If you just want to do a keyword search on the mails you sent, why not store the outgoing mail in DB and do the search ? (as you said "somehow fetch that email")

  2. To be able to receive emails in your rails app, you would need to implement the receive method in your mailer. Follow this link - link

  3. If you meant fetching emails from your inbox then you have to use POP3. Follow this SO answer - link

Im not sure whats your requirement but I'm sure you will find the above links useful :)

Upvotes: 3

Related Questions