diff --git a/kitchen_counter/MNF/settings.py b/kitchen_counter/MNF/settings.py index f8f0022..e2885e3 100755 --- a/kitchen_counter/MNF/settings.py +++ b/kitchen_counter/MNF/settings.py @@ -642,8 +642,20 @@ ISO_LAN = {v: k for k, v in languages.items()} # ] +#EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER') +#EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD') + +EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' + +# SMTP server settings +EMAIL_HOST = 'smtp.gmail.com' # Replace 'smtp.example.com' with your SMTP server address +EMAIL_PORT = 587 # Replace with your SMTP server port, typically 587 for TLS/STARTTLS +EMAIL_USE_TLS = True # Enable TLS/STARTTLS if required + +# SMTP authentication settings +#EMAIL_HOST_USER = 'your_email@example.com' # Replace with your email address +EMAIL_HOST_PASSWORD = 'iiby yciy jdux fslv' # Replace with your email password EMAIL_HOST_USER = os.environ.get('EMAIL_HOST_USER') -EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_HOST_PASSWORD') smtp_host = os.environ.get('SMTP_HOST') smtp_port = int(os.environ.get('SMTP_PORT')) @@ -653,6 +665,8 @@ smtp_password = os.environ.get('SMTP_PASSWORD') COUNTRY_KEY = "00000000000000000000000000000000" + + def discount_xlsx_reader(filePath:str): import pandas as pd discountData = dict() diff --git a/kitchen_counter/auto_email/views.py b/kitchen_counter/auto_email/views.py index cca2069..a001c23 100755 --- a/kitchen_counter/auto_email/views.py +++ b/kitchen_counter/auto_email/views.py @@ -160,9 +160,11 @@ def mailer(all_email,email_code,key_value,filePath): port = int(email_data.iloc[0, 2]) password = emails_creadentials.objects.get(email=from_email) print("before connection") - connection = get_connection(host=host,port=port,username=from_email,password=password.password,use_tls=True) + #connection = get_connection(host=host,port=port,username=from_email,password=password.password,use_tls=True) + from_email1 = "mynextfilm " + # send_mail(message['subject'],title[1],from_email=from_email,recipient_list=[to_email],html_message=msg_html,connection=connection) - sendMail = EmailMultiAlternatives(message['subject'],title[1],from_email,to=[to_email],connection=connection) + sendMail = EmailMultiAlternatives(message['subject'],title[1],from_email1,[to_email]) print("after connection") sendMail.attach_alternative(msg_html,"text/html") if filePath is not None: