mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
Litellm dev 02 12 2025 p1 (#8494)
* Resolves https://github.com/BerriAI/litellm/issues/6625 (#8459) - enables no auth for SMTP Signed-off-by: Regli Daniel <daniel.regli1@sanitas.com> * add sonar pricings (#8476) * add sonar pricings * Update model_prices_and_context_window.json * Update model_prices_and_context_window.json * Update model_prices_and_context_window_backup.json * test: fix test --------- Signed-off-by: Regli Daniel <daniel.regli1@sanitas.com> Co-authored-by: Dani Regli <1daniregli@gmail.com> Co-authored-by: Lucca Zenóbio <luccazen@gmail.com>
This commit is contained in:
parent
1dc3c66630
commit
a78dd1cf97
5 changed files with 44 additions and 11 deletions
|
@ -2322,12 +2322,6 @@ async def send_email(receiver_email, subject, html):
|
|||
if smtp_host is None:
|
||||
raise ValueError("Trying to use SMTP, but SMTP_HOST is not set")
|
||||
|
||||
if smtp_username is None:
|
||||
raise ValueError("Trying to use SMTP, but SMTP_USERNAME is not set")
|
||||
|
||||
if smtp_password is None:
|
||||
raise ValueError("Trying to use SMTP, but SMTP_PASSWORD is not set")
|
||||
|
||||
# Attach the body to the email
|
||||
email_message.attach(MIMEText(html, "html"))
|
||||
|
||||
|
@ -2337,8 +2331,9 @@ async def send_email(receiver_email, subject, html):
|
|||
if os.getenv("SMTP_TLS", "True") != "False":
|
||||
server.starttls()
|
||||
|
||||
# Login to your email account
|
||||
server.login(smtp_username, smtp_password) # type: ignore
|
||||
# Login to your email account only if smtp_username and smtp_password are provided
|
||||
if smtp_username and smtp_password:
|
||||
server.login(smtp_username, smtp_password) # type: ignore
|
||||
|
||||
# Send the email
|
||||
server.send_message(email_message)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue