# Example with Restmail.net

[Restmail.net](http://restmail.net/) is probably the simplest toll to start with. It's free, it's requires no registration, it allows to create dynamically inboxes, it exposes a REST API to read received emails. However all the sent messages are public.&#x20;

Let's take the previous test suite and modify it a bit. For Restmail.net we need user alias instead of email to check the inbox. So we can generate it like that.

![User alias for Restmail.net](https://2843146877-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdyKJ-zzeS2hB7DF04J%2F-LiDeZCjmLSlVCpRxMEu%2F-LiDgHAJHk-1Av_S9oCV%2Frestmail1.PNG?alt=media\&token=935b10f7-7169-4580-ae09-2ecfa2a1c2e0)

As you see we also changed `TEST_EMAIL` template variable generation. Now it build based on earlier created `TEST_USER_ALIAS` one.

Next we find `page.assignVarRemotely` command and update the URL for of of Restmail.net:

```
http://restmail.net/mail/{{ TEST_USER_ALIAS }}
```

What we need now is a custom parser function in `page.assignVarRemotely` :

```javascript
( json, payload ) => {
  const parseActivationLink = ( text ) => {
          const re = /(http\:[^\"]+4567\/con[^\"]+)/g,
                res = text.match( re );
          return res ? res[ 0 ].replace( "=\r\n", "" ) : null;
        },
        sentAt =  payload.sentAt,
        unseen = json.find( msg => new Date( msg.receivedAt ) > new Date( sentAt ) );

  if ( !unseen ) {
    return null;
  }

  return parseActivationLink( unseen.html );
}
```

The function has second parameter `payload` with `sentAt` property that contains sending event timestamp. Here we check if there are any messages received  later then the application under test sent the activation email. If any found we parse it for the activation link.

Our `page.assignVarRemotely` command configuration shall look now like that:

![page.assignVarRemotely configuration ](https://2843146877-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdyKJ-zzeS2hB7DF04J%2F-LiIOtRXwOKeIG7qY4hb%2F-LiIP-V5ybN7WKbDU9N_%2Frestmail-assign-var-remotely.png?alt=media\&token=55965e23-05e7-4bd4-9ad1-9116db5808b5)

Now we can save the changes and run the tests. On the generated screenshots we can see that a new account was created and activated.
