rnwood / smtp4dev

smtp4dev - the fake smtp email server for development and testing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to connect to the local smtp4dev instance programatically via IMAP ?

jprealini opened this issue · comments

Hi!

I know this is not a bug, but had no idea where to ask this question.

I am trying to use a containerized instance of smtp4dev for email testing from Cypress. Is there a way to use a javascript/node imap client to connect to the running smtp4dev service and fetch emails (I guess via IMAP) ?
I built a similar implementation using Ethereal and connecting to it using a package called IMAPFLOW, but can't seem to find an imap client that will allow me to connect to smtp4dev like that

THanks!

I do something similar but with java sort of like this

// The "smtp" session
Session session = Session.getInstance(getProperties());

// The actual store that uses IMAP
store = session.getStore("imap");
store.connect("localhost", "", "");

// An instance to the inbox, searching is also possible
emailInbox = store.getFolder("INBOX");
emailInbox.open(Folder.READ_WRITE);

I have a more complete example in this issue.