PocketBase provides a simple abstraction for sending emails via the app.NewMailClient() factory.

Depending on your configured mail settings (Dashboard > Settings > Mail settings) it will use the sendmail command or a SMTP client.

You can send your own custom email from anywhere within the app (hooks, middlewares, routes, etc.) by using app.NewMailClient().Send(message). Here is an example of sending a custom email after user registration:

If you want to overwrite the default system emails for forgotten password, verification, etc., you can adjust the default templates available from the Dashboard > Collections > Edit collection > Options .

Alternatively, you can also apply individual changes by binding to one of the mailer hooks. Here is an example of appending a Record field value to the subject using the OnMailerRecordPasswordResetSend hook: