FirstMail
class · namespace z3n7 · source Mail/FirstMail.cs
public class FirstMail
Client of the FirstMail mailbox API (firstmail.ltd). API key, default login, password and proxy come from the _api table, row id = 'firstmail' (apikey, apisecret, passphrase, proxy). Responses are loaded into project.Json. The client signs in to the mailbox that receives forwarded mail. An email argument is the original recipient: the address the message was sent to, which forwarded it to this mailbox.
Constructors
FirstMail
public FirstMail(IZennoPosterProjectModel project, Logger log = null)
Creates a client for the mailbox stored in the database.
| Parameter | Description |
|---|---|
log |
Not used. |
public FirstMail(IZennoPosterProjectModel project, string mail, string password, Logger log = null)
Creates a client for the given mailbox; the API key and proxy still come from the database.
| Parameter | Description |
|---|---|
mail |
Mailbox address. |
password |
Mailbox password. |
log |
Not used. |
Methods
Delete
public string Delete(string email, bool seen = false)
Calls /v1/mail/delete for the client's mailbox.
| Parameter | Description |
|---|---|
email |
Original recipient; not used. |
seen |
Append seen=true to the request URL. |
Get
public string Get(int limit = 5)
Latest INBOX messages of the client's mailbox (/api/v1/email/messages).
| Parameter | Description |
|---|---|
limit |
How many. |
Returns: JSON array of messages.
GetAll
public string GetAll(string email)
Messages of the client's mailbox (/v1/get/messages).
| Parameter | Description |
|---|---|
email |
Original recipient; not used. |
GetLink
public string GetLink(string email)
Takes the latest message; when its first recipient contains email, returns the first http(s) link of its text.
| Parameter | Description |
|---|---|
email |
Original recipient the message was sent to. |
Returns: The link. Throws when there is none.
GetOne
public string GetOne(string email)
Latest message of the client's mailbox (/v1/mail/one).
| Parameter | Description |
|---|---|
email |
Original recipient; not used. |
GetOTP
public string GetOTP(string email)
Takes the latest message; when its first recipient contains email, returns the first 6-digit number of the subject, text or HTML.
| Parameter | Description |
|---|---|
email |
Original recipient the message was sent to. |
Returns: The code. Throws when the latest message is for another address or has no code.
Otp
public string Otp(string email)
Looks through the latest 5 INBOX messages for one sent to email and returns the first 6-digit number of its subject, text or HTML.
| Parameter | Description |
|---|---|
email |
Original recipient the message was sent to. |
Returns: The code. Throws when none is found.