> For the complete documentation index, see [llms.txt](https://docs.ask.edvard.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ask.edvard.dev/built-in-utilities/email.md).

# Email

Send email from you Ask app

Ask has a built in tool for sending email messages. You just have to configure it to use an SMTP server (e.g. Gmail) and you're good to go.

## Setup/Configuration

You configure the mail tool from your projects [Askfile](/askfile.md). In this example we're connecting to gmail.

```yaml
[mail]
debug=true
server='smtp.gmail.com'
port=465
use_tls=false
use_ssl=true
username=''
password=''
```

{% hint style="info" %}
When using Gmail, make sure to either use App specific passwords, or enable less secure apps.&#x20;

You also have to enable IMAP, and sometimes complete the steps here: <https://accounts.google.com/b/2/DisplayUnlockCaptcha>
{% endhint %}

## The Mail Class

All functions and events related to emails are available under built-in the `mail`  class.

## Example App

```python
@get('/email'):
	msg = mail.msg('Subject line', ['recipient@gmail.com'], 'Message body.')
	mail.send(msg)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ask.edvard.dev/built-in-utilities/email.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
