Skip to content

Commit

Permalink
v1.1.6 closes #149 #147 #146
Browse files Browse the repository at this point in the history
  • Loading branch information
sabuhish committed Oct 6, 2022
1 parent 54f396b commit ba3871e
Show file tree
Hide file tree
Showing 9 changed files with 303 additions and 90 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ conf = ConnectionConfig(
MAIL_FROM = "[email protected]",
MAIL_PORT = 587,
MAIL_SERVER = "your mail server",
MAIL_TLS = True,
MAIL_SSL = False,
MAIL_STARTTLS = True,
MAIL_SSL_TLS = False,
USE_CREDENTIALS = True,
VALIDATE_CERTS = True
)
Expand All @@ -80,8 +80,7 @@ async def simple_send(email: EmailSchema) -> JSONResponse:
subject="Fastapi-Mail module",
recipients=email.dict().get("email"), # List of recipients, as many as you can pass
body=html,
subtype="html"
)
subtype="html")

fm = FastMail(conf)
await fm.send_message(message)
Expand All @@ -103,7 +102,6 @@ Thanks goes to these wonderful people ([🚧](https://sabuhish.github.io/fastapi

<table>
<tr>
<td align="center"><a href="https://github.com/sabuhish"><img src="https://avatars.githubusercontent.com/u/46589585?v=3" width="100px;" alt=""/><br /><sub><b>Sabuhi Shukurov</b></sub></a><br /><a href="#maintenance-tbenning" title="Answering Questions">💬</a> <a href="https://github.com/sabuhish/fastapi-mail/" title="Reviewed Pull Requests">👀</a> <a href="#maintenance-jakebolam" title="Maintenance">🚧</a></td>
<td align="center"><a href="https://github.com/Turall"><img src="https://avatars.githubusercontent.com/u/32899328?v=3" width="100px;" alt=""/><br /><sub><b>Tural Muradov</b></sub></a><br /><a href="https://github.com/sabuhish/fastapi-mail/" title="Documentation">📖</a> <a href="https://github.com/sabuhish/fastapi-mail/" title="Reviewed Pull Requests">👀</a> <a href="#tool-jfmengels" title="Tools">🔧</a></td>
<td align="center"><a href="https://github.com/AliyevH"><img src="https://avatars.githubusercontent.com/u/5507950?v=3" width="100px;" alt=""/><br /><sub><b>Hasan Aliyev</b></sub></a><br /><a href="https://github.com/sabuhish/fastapi-mail/" title="Documentation">📖</a> <a href="#maintenance-jakebolam" title="Maintenance">🚧</a> <a href="https://github.com/sabuhish/fastapi-mail/" title="Reviewed Pull Requests">👀</a></td>
<td align="center"><a href="https://github.com/imaskm"><img src="https://avatars.githubusercontent.com/u/20543833?v=3" width="100px;" alt=""/><br /><sub><b>Ashwani</b></sub></a><br /><a href="#maintenance-tbenning" title="Maintenance">🚧</a></td>
Expand Down
12 changes: 6 additions & 6 deletions docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ conf = ConnectionConfig(
MAIL_PORT = 587,
MAIL_SERVER = "your mail server",
MAIL_FROM_NAME="Desired Name",
MAIL_TLS = True,
MAIL_SSL = False,
MAIL_STARTTLS = True,
MAIL_SSL_TLS = False,
USE_CREDENTIALS = True,
VALIDATE_CERTS = True
)
Expand Down Expand Up @@ -120,8 +120,8 @@ conf = ConnectionConfig(
MAIL_FROM = "[email protected]",
MAIL_PORT = 587,
MAIL_SERVER = "your mail server",
MAIL_TLS = True,
MAIL_SSL = False,
MAIL_STARTTLS = True,
MAIL_SSL_TLS = False,
TEMPLATE_FOLDER = Path(__file__).parent / 'templates',
)

Expand Down Expand Up @@ -410,8 +410,8 @@ conf = ConnectionConfig(
MAIL_FROM = "[email protected]",
MAIL_PORT = 587,
MAIL_SERVER = "your mail server",
MAIL_TLS = True,
MAIL_SSL = False,
MAIL_STARTTLS = True,
MAIL_SSL_TLS = False,
TEMPLATE_FOLDER = Path(__file__).parent / 'templates',

# if no indicated SUPPRESS_SEND defaults to 0 (false) as below
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class has following attributes
- If you service does not provide username use sender address for connection.
- MAIL_PASSWORD : Password for authentication
- MAIL_SERVER : SMTP Mail server.
- MAIL_TLS : For TLS connection
- MAIL_SSL : For TLS connection
- MAIL_STARTTLS : For STARTTLS connections
- MAIL_SSL_TLS : For connecting over TLS/SSL
- MAIL_DEBUG : Debug mode for while sending mails, defaults 0.
- MAIL_FROM : Sender address
- MAIL_FROM_NAME : Title for Mail
Expand Down
4 changes: 2 additions & 2 deletions examples/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
MAIL_FROM='[email protected]',
MAIL_PORT=587,
MAIL_SERVER='your mail server',
MAIL_TLS=True,
MAIL_SSL=False,
MAIL_STARTTLS=True,
MAIL_SSL_TLS=False,
)

app = FastAPI()
Expand Down
4 changes: 2 additions & 2 deletions fastapi_mail/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class ConnectionConfig(Settings):
MAIL_PASSWORD: str
MAIL_PORT: int = 465
MAIL_SERVER: str
MAIL_TLS: bool = False
MAIL_SSL: bool = True
MAIL_STARTTLS: bool = False
MAIL_SSL_TLS: bool = True
MAIL_DEBUG: conint(gt=-1, lt=2) = 0 # type: ignore
MAIL_FROM: EmailStr
MAIL_FROM_NAME: Optional[str] = None
Expand Down
8 changes: 4 additions & 4 deletions fastapi_mail/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def __init__(self, settings: ConnectionConfig):
MAIL_FROM="your_from_email",
MAIL_PORT=587,
MAIL_SERVER="email_service",
MAIL_TLS=True,
MAIL_SSL=False
MAIL_STARTTLS=True,
MAIL_SSL_TLS=False
)
"""
)
Expand All @@ -46,8 +46,8 @@ async def _configure_connection(self):
self.session = aiosmtplib.SMTP(
hostname=self.settings.get('MAIL_SERVER'),
port=self.settings.get('MAIL_PORT'),
use_tls=self.settings.get('MAIL_SSL'),
start_tls=self.settings.get('MAIL_TLS'),
use_tls=self.settings.get('MAIL_SSL_TLS'),
start_tls=self.settings.get('MAIL_STARTTLS'),
validate_certs=self.settings.get('VALIDATE_CERTS'),
)

Expand Down
Loading

0 comments on commit ba3871e

Please sign in to comment.