Skip to content

Commit 2ba52e8

Browse files
author
Robert-Jan Lub
committed
add local hostname setting
1 parent d74266d commit 2ba52e8

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

docs/getting-started.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class has following attributes
3232
- SUPPRESS_SEND: To mock sending out mail, defaults 0.
3333
- USE_CREDENTIALS: Defaults to `True`. However it enables users to choose whether or not to login to their SMTP server.
3434
- VALIDATE_CERTS: Defaults to `True`. It enables to choose whether to verify the mail server's certificate
35+
- LOCAL_HOSTNAME: It enables to set the hostname of the local machine, which is used to connect to the SMTP server.
3536

3637

3738
### ```MessageSchema``` class

fastapi_mail/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ConnectionConfig(Settings):
2121
USE_CREDENTIALS: bool = True
2222
VALIDATE_CERTS: bool = True
2323
TIMEOUT: int = DEFAULT_TIMEOUT
24+
LOCAL_HOSTNAME: Optional[str] = None
2425

2526
def template_engine(self) -> Environment:
2627
"""

fastapi_mail/connection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ async def _configure_connection(self) -> None:
3939
use_tls=self.settings.MAIL_SSL_TLS,
4040
start_tls=self.settings.MAIL_STARTTLS,
4141
validate_certs=self.settings.VALIDATE_CERTS,
42+
local_hostname=self.settings.LOCAL_HOSTNAME,
4243
)
4344

4445
if not self.settings.SUPPRESS_SEND: # for test environ

0 commit comments

Comments
 (0)