Re: Email Sending In Django not working

2023-01-24 Thread It's Aladdin
guys use this code for sending emails, it's working as of now
import smtplib

my_email = "some...@gmail.com"
password = "sfuyyudfgyudgfydsg"

with smtplib.SMTP('smtp.gmail.com') as connection:
connection.starttls()
connection.login(user=my_email, password=password)
connection.sendmail(
from_addr=my_email,
to_addrs="samaniabdussala...@gmail.com",
msg="Subject: Checking out automated mail in Python\n\nI don't
know what error I will get, there is only one way to find out.."
)

On Mon, Nov 14, 2022 at 6:13 PM Lakshyaraj Dash
 wrote:
>
> The app name can be any name
>
> On Mon, Nov 14, 2022, 18:11 peterumimo2  wrote:
>>
>> I have watched the video please the app name must be any name or your 
>> project name
>>
>>
>>
>> Sent from my Samsung Galaxy smartphone.
>>
>>  Original message 
>> From: Lakshyaraj Dash 
>> Date: 14/11/2022 13:16 (GMT+01:00)
>> To: django-users@googlegroups.com
>> Subject: Re: Email Sending In Django not working
>>
>> Please watch this video and ensure that you've properly configured the port 
>> numbers also your email address and password.
>> Note: Your email password should be the app password generated no your 
>> actual Gmail password
>>
>> https://youtu.be/uVDq4VOBMNM
>>
>> On Mon, Nov 14, 2022, 17:41 peteru mimo  wrote:
>>>
>>> I have done all this still not working
>>>
>>> On Wednesday, November 9, 2022 at 4:34:49 PM UTC+1 dashlaksh...@gmail.com 
>>> wrote:
>>>>
>>>> Even if Google has stopped the support, emails can be still sent using two 
>>>> step verification and generating app passwords after enabling two step 
>>>> verification. Please update you email password with the generated app 
>>>> password.
>>>>
>>>> Steps:
>>>> 1. Go to manage my Google account
>>>> 2. Go to security tab
>>>> 3. Enable two step verification and verify yourself
>>>> 4. Create your app passwords after the app passwords in the security 
>>>> settings is visible
>>>> 5. Select the app name (or add your custom app name) and click generate.
>>>> 6. Copy the app password as it's view once and cannot be viewed after the 
>>>> pop up is closed.
>>>> 7. Go to your settings.py file and replace your actual email password with 
>>>> the generated app password.
>>>>
>>>> Yay! You're all set.
>>>>
>>>> Dear It's Alladin, please try this also to the one who asked this question 
>>>> please try it once.
>>>>
>>>> Thanks and Regards
>>>> Lakshyaraj Dash
>>>> On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:
>>>>>
>>>>> Google hast stopped less secure apps, so u cant send email messages 
>>>>> anymore with ur email and password, U will have to find some other way of 
>>>>> sending mails.
>>>>>
>>>>> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>>>>>>
>>>>>> Good day team,
>>>>>>
>>>>>> I have been facing this challenge in sending mail in django
>>>>>>
>>>>>> here is the error "A connection attempt failed because the connected 
>>>>>> party did not properly respond after a period of time, or established 
>>>>>> connection failed because connected host has failed to respond"
>>>>>>
>>>>>> Code
>>>>>> def send_verification_email(request, user):
>>>>>> from_email = settings.DEFAULT_FROM_EMAIL
>>>>>> current_site = get_current_site(request)
>>>>>> mail_subject = 'Please activate your account'
>>>>>> message = 
>>>>>> render_to_string('accounts/emails/account_verification_email.html', {
>>>>>> 'user': user,
>>>>>> 'domain': current_site,
>>>>>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>>>>>> 'token': default_token_generator.make_token(user),
>>>>>> })
>>>>>> to_email = user.email
>>>>>> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
>>>>>> mail.send()
>>>>>>
>>>>>> Settings
>>>>>> EMAIL_HOST = 'smtp.google.com'
>>>>>> EMAIL_P

Re: Email Sending In Django not working

2022-11-14 Thread peteru mimo
Thank you all i have figure it out.  EMAIL_HOST = 'smtp.google.com' instead 
of  EMAIL_HOST = 'smtp.gmail.com <http://smtp.google.com/>'

On Monday, November 14, 2022 at 1:43:24 PM UTC+1 dashlaksh...@gmail.com 
wrote:

> The app name can be any name
>
> On Mon, Nov 14, 2022, 18:11 peterumimo2  wrote:
>
>> I have watched the video please the app name must be any name or your 
>> project name
>>
>>
>>
>> Sent from my Samsung Galaxy smartphone.
>>
>>  Original message 
>> From: Lakshyaraj Dash  
>> Date: 14/11/2022 13:16 (GMT+01:00) 
>> To: django...@googlegroups.com 
>> Subject: Re: Email Sending In Django not working 
>>
>> Please watch this video and ensure that you've properly configured the 
>> port numbers also your email address and password.
>> *Note: Your email password should be the app password generated no your 
>> actual Gmail password*
>>
>> https://youtu.be/uVDq4VOBMNM
>>
>> On Mon, Nov 14, 2022, 17:41 peteru mimo  wrote:
>>
>>> I have done all this still not working
>>>
>>> On Wednesday, November 9, 2022 at 4:34:49 PM UTC+1 
>>> dashlaksh...@gmail.com wrote:
>>>
>>>> Even if Google has stopped the support, emails can be still sent using 
>>>> two step verification and generating app passwords after enabling two step 
>>>> verification. Please update you email password with the generated app 
>>>> password.
>>>>
>>>> Steps:
>>>> 1. Go to manage my Google account
>>>> 2. Go to security tab
>>>> 3. Enable two step verification and verify yourself
>>>> 4. Create your app passwords after the app passwords in the security 
>>>> settings is visible
>>>> 5. Select the app name (or add your custom app name) and click generate.
>>>> 6. Copy the app password as it's view once and cannot be viewed after 
>>>> the pop up is closed.
>>>> 7. Go to your settings.py file and replace your actual email password 
>>>> with the generated app password.
>>>>
>>>> Yay! You're all set.
>>>>
>>>> Dear It's Alladin, please try this also to the one who asked this 
>>>> question please try it once.
>>>>
>>>> Thanks and Regards
>>>> Lakshyaraj Dash
>>>> On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:
>>>>
>>>>> Google hast stopped less secure apps, so u cant send email messages 
>>>>> anymore with ur email and password, U will have to find some other way of 
>>>>> sending mails.
>>>>>
>>>>> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>>>>>
>>>>>> Good day team,
>>>>>>
>>>>>> I have been facing this challenge in sending mail in django
>>>>>>
>>>>>> here is the error *"A connection attempt failed because the 
>>>>>> connected party did not properly respond after a period of time, or 
>>>>>> established connection failed because connected host has failed to 
>>>>>> respond"*
>>>>>>
>>>>>> *Code*
>>>>>> def send_verification_email(request, user):
>>>>>> from_email = settings.DEFAULT_FROM_EMAIL
>>>>>> current_site = get_current_site(request)
>>>>>> mail_subject = 'Please activate your account'
>>>>>> message = 
>>>>>> render_to_string('accounts/emails/account_verification_email.html', {
>>>>>> 'user': user,
>>>>>> 'domain': current_site,
>>>>>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>>>>>> 'token': default_token_generator.make_token(user),
>>>>>> })
>>>>>> to_email = user.email
>>>>>> mail = EmailMessage(mail_subject, from_email, message, 
>>>>>> to=[to_email])
>>>>>> mail.send()
>>>>>>
>>>>>> *Settings*
>>>>>> EMAIL_HOST = 'smtp.google.com'
>>>>>> EMAIL_POST = '587'
>>>>>> EMAIL_HOST_USER = 'myemail'
>>>>>> EMAIL_HOST_PASSWORD = 'email_password'
>>>>>> EMAIL_USE_TLS = True
>>>>>>
>>>>>> Any solution will be appreciated. Thank you
>>>>>>
>>>>>> -- 
>>>>>> You received this message

Re: Email Sending In Django not working

2022-11-14 Thread Lakshyaraj Dash
The app name can be any name

On Mon, Nov 14, 2022, 18:11 peterumimo2  wrote:

> I have watched the video please the app name must be any name or your
> project name
>
>
>
> Sent from my Samsung Galaxy smartphone.
>
>  Original message 
> From: Lakshyaraj Dash 
> Date: 14/11/2022 13:16 (GMT+01:00)
> To: django-users@googlegroups.com
> Subject: Re: Email Sending In Django not working
>
> Please watch this video and ensure that you've properly configured the
> port numbers also your email address and password.
> *Note: Your email password should be the app password generated no your
> actual Gmail password*
>
> https://youtu.be/uVDq4VOBMNM
>
> On Mon, Nov 14, 2022, 17:41 peteru mimo  wrote:
>
>> I have done all this still not working
>>
>> On Wednesday, November 9, 2022 at 4:34:49 PM UTC+1 dashlaksh...@gmail.com
>> wrote:
>>
>>> Even if Google has stopped the support, emails can be still sent using
>>> two step verification and generating app passwords after enabling two step
>>> verification. Please update you email password with the generated app
>>> password.
>>>
>>> Steps:
>>> 1. Go to manage my Google account
>>> 2. Go to security tab
>>> 3. Enable two step verification and verify yourself
>>> 4. Create your app passwords after the app passwords in the security
>>> settings is visible
>>> 5. Select the app name (or add your custom app name) and click generate.
>>> 6. Copy the app password as it's view once and cannot be viewed after
>>> the pop up is closed.
>>> 7. Go to your settings.py file and replace your actual email password
>>> with the generated app password.
>>>
>>> Yay! You're all set.
>>>
>>> Dear It's Alladin, please try this also to the one who asked this
>>> question please try it once.
>>>
>>> Thanks and Regards
>>> Lakshyaraj Dash
>>> On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:
>>>
>>>> Google hast stopped less secure apps, so u cant send email messages
>>>> anymore with ur email and password, U will have to find some other way of
>>>> sending mails.
>>>>
>>>> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>>>>
>>>>> Good day team,
>>>>>
>>>>> I have been facing this challenge in sending mail in django
>>>>>
>>>>> here is the error *"A connection attempt failed because the connected
>>>>> party did not properly respond after a period of time, or established
>>>>> connection failed because connected host has failed to respond"*
>>>>>
>>>>> *Code*
>>>>> def send_verification_email(request, user):
>>>>> from_email = settings.DEFAULT_FROM_EMAIL
>>>>> current_site = get_current_site(request)
>>>>> mail_subject = 'Please activate your account'
>>>>> message =
>>>>> render_to_string('accounts/emails/account_verification_email.html', {
>>>>> 'user': user,
>>>>> 'domain': current_site,
>>>>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>>>>> 'token': default_token_generator.make_token(user),
>>>>> })
>>>>> to_email = user.email
>>>>> mail = EmailMessage(mail_subject, from_email, message,
>>>>> to=[to_email])
>>>>> mail.send()
>>>>>
>>>>> *Settings*
>>>>> EMAIL_HOST = 'smtp.google.com'
>>>>> EMAIL_POST = '587'
>>>>> EMAIL_HOST_USER = 'myemail'
>>>>> EMAIL_HOST_PASSWORD = 'email_password'
>>>>> EMAIL_USE_TLS = True
>>>>>
>>>>> Any solution will be appreciated. Thank you
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django-users...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>&

Re: Email Sending In Django not working

2022-11-14 Thread peterumimo2
I have watched the video please the app name must be any name or your project 
nameSent from my Samsung Galaxy smartphone.
 Original message From: Lakshyaraj Dash 
 Date: 14/11/2022  13:16  (GMT+01:00) To: 
django-users@googlegroups.com Subject: Re: Email Sending In Django not working 
Please watch this video and ensure that you've properly configured the port 
numbers also your email address and password.Note: Your email password should 
be the app password generated no your actual Gmail 
passwordhttps://youtu.be/uVDq4VOBMNMOn Mon, Nov 14, 2022, 17:41 peteru mimo 
 wrote:I have done all this still not workingOn 
Wednesday, November 9, 2022 at 4:34:49 PM UTC+1 dashlaksh...@gmail.com 
wrote:Even if Google has stopped the support, emails can be still sent using 
two step verification and generating app passwords after enabling two step 
verification. Please update you email password with the generated app 
password.Steps:1. Go to manage my Google account2. Go to security tab3. Enable 
two step verification and verify yourself4. Create your app passwords after the 
app passwords in the security settings is visible5. Select the app name (or add 
your custom app name) and click generate.6. Copy the app password as it's view 
once and cannot be viewed after the pop up is closed.7. Go to your settings.py 
file and replace your actual email password with the generated app 
password.Yay! You're all set.Dear It's Alladin, please try this also to the one 
who asked this question please try it once.Thanks and RegardsLakshyaraj DashOn 
Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:Google hast 
stopped less secure apps, so u cant send email messages anymore with ur email 
and password, U will have to find some other way of sending mails.On Wed, 9 
Nov, 2022, 16:26 peteru mimo,  wrote:Good day team,I have 
been facing this challenge in sending mail in djangohere is the error "A 
connection attempt failed because the connected party did not properly respond 
after a period of time, or established connection failed because connected host 
has failed to respond"Codedef send_verification_email(request, user):    
from_email = settings.DEFAULT_FROM_EMAIL    current_site = 
get_current_site(request)    mail_subject = 'Please activate your account'    
message = render_to_string('accounts/emails/account_verification_email.html', { 
       'user': user,        'domain': current_site,        'uid': 
urlsafe_base64_encode(force_bytes(user.pk)),        'token': 
default_token_generator.make_token(user),    })    to_email = user.email    
mail = EmailMessage(mail_subject, from_email, message, to=[to_email])    
mail.send()SettingsEMAIL_HOST = 'smtp.google.com'EMAIL_POST = 
'587'EMAIL_HOST_USER = 'myemail'EMAIL_HOST_PASSWORD = 
'email_password'EMAIL_USE_TLS = TrueAny solution will be appreciated. Thank you



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com.





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e0ee8cb9-cc9a-47b7-9c99-71a3f1bdf0efn%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF7qQgDc-3NCW0xdUaUEn%2BzgJ9TxKsV%3DjTAsk55wicoDpCqTAw%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63723757.5d0a0220.a3a9b.390e%40mx.google.com.


Re: Email Sending In Django not working

2022-11-14 Thread Lakshyaraj Dash
Please watch this video and ensure that you've properly configured the port
numbers also your email address and password.
*Note: Your email password should be the app password generated no your
actual Gmail password*

https://youtu.be/uVDq4VOBMNM

On Mon, Nov 14, 2022, 17:41 peteru mimo  wrote:

> I have done all this still not working
>
> On Wednesday, November 9, 2022 at 4:34:49 PM UTC+1 dashlaksh...@gmail.com
> wrote:
>
>> Even if Google has stopped the support, emails can be still sent using
>> two step verification and generating app passwords after enabling two step
>> verification. Please update you email password with the generated app
>> password.
>>
>> Steps:
>> 1. Go to manage my Google account
>> 2. Go to security tab
>> 3. Enable two step verification and verify yourself
>> 4. Create your app passwords after the app passwords in the security
>> settings is visible
>> 5. Select the app name (or add your custom app name) and click generate.
>> 6. Copy the app password as it's view once and cannot be viewed after the
>> pop up is closed.
>> 7. Go to your settings.py file and replace your actual email password
>> with the generated app password.
>>
>> Yay! You're all set.
>>
>> Dear It's Alladin, please try this also to the one who asked this
>> question please try it once.
>>
>> Thanks and Regards
>> Lakshyaraj Dash
>> On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:
>>
>>> Google hast stopped less secure apps, so u cant send email messages
>>> anymore with ur email and password, U will have to find some other way of
>>> sending mails.
>>>
>>> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>>>
 Good day team,

 I have been facing this challenge in sending mail in django

 here is the error *"A connection attempt failed because the connected
 party did not properly respond after a period of time, or established
 connection failed because connected host has failed to respond"*

 *Code*
 def send_verification_email(request, user):
 from_email = settings.DEFAULT_FROM_EMAIL
 current_site = get_current_site(request)
 mail_subject = 'Please activate your account'
 message =
 render_to_string('accounts/emails/account_verification_email.html', {
 'user': user,
 'domain': current_site,
 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
 'token': default_token_generator.make_token(user),
 })
 to_email = user.email
 mail = EmailMessage(mail_subject, from_email, message,
 to=[to_email])
 mail.send()

 *Settings*
 EMAIL_HOST = 'smtp.google.com'
 EMAIL_POST = '587'
 EMAIL_HOST_USER = 'myemail'
 EMAIL_HOST_PASSWORD = 'email_password'
 EMAIL_USE_TLS = True

 Any solution will be appreciated. Thank you

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to django-users...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users...@googlegroups.com.
>>>
>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e0ee8cb9-cc9a-47b7-9c99-71a3f1bdf0efn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF7qQgDc-3NCW0xdUaUEn%2BzgJ9TxKsV%3DjTAsk55wicoDpCqTAw%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-14 Thread peteru mimo
I have done all this still not working

On Wednesday, November 9, 2022 at 4:34:49 PM UTC+1 dashlaksh...@gmail.com 
wrote:

> Even if Google has stopped the support, emails can be still sent using two 
> step verification and generating app passwords after enabling two step 
> verification. Please update you email password with the generated app 
> password.
>
> Steps:
> 1. Go to manage my Google account
> 2. Go to security tab
> 3. Enable two step verification and verify yourself
> 4. Create your app passwords after the app passwords in the security 
> settings is visible
> 5. Select the app name (or add your custom app name) and click generate.
> 6. Copy the app password as it's view once and cannot be viewed after the 
> pop up is closed.
> 7. Go to your settings.py file and replace your actual email password with 
> the generated app password.
>
> Yay! You're all set.
>
> Dear It's Alladin, please try this also to the one who asked this question 
> please try it once.
>
> Thanks and Regards
> Lakshyaraj Dash
> On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:
>
>> Google hast stopped less secure apps, so u cant send email messages 
>> anymore with ur email and password, U will have to find some other way of 
>> sending mails.
>>
>> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>>
>>> Good day team,
>>>
>>> I have been facing this challenge in sending mail in django
>>>
>>> here is the error *"A connection attempt failed because the connected 
>>> party did not properly respond after a period of time, or established 
>>> connection failed because connected host has failed to respond"*
>>>
>>> *Code*
>>> def send_verification_email(request, user):
>>> from_email = settings.DEFAULT_FROM_EMAIL
>>> current_site = get_current_site(request)
>>> mail_subject = 'Please activate your account'
>>> message = 
>>> render_to_string('accounts/emails/account_verification_email.html', {
>>> 'user': user,
>>> 'domain': current_site,
>>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>>> 'token': default_token_generator.make_token(user),
>>> })
>>> to_email = user.email
>>> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
>>> mail.send()
>>>
>>> *Settings*
>>> EMAIL_HOST = 'smtp.google.com'
>>> EMAIL_POST = '587'
>>> EMAIL_HOST_USER = 'myemail'
>>> EMAIL_HOST_PASSWORD = 'email_password'
>>> EMAIL_USE_TLS = True
>>>
>>> Any solution will be appreciated. Thank you
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to django-users...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e0ee8cb9-cc9a-47b7-9c99-71a3f1bdf0efn%40googlegroups.com.


Re: Email Sending In Django not working

2022-11-09 Thread Ahmed omar miladi
you can use the function send mail of django

Téléchargez Outlook pour iOS<https://aka.ms/o0ukef>

De : django-users@googlegroups.com  de la part 
de It's Aladdin 
Envoyé : Wednesday, November 9, 2022 12:06:33 PM
À : django-users@googlegroups.com 
Objet : Re: Email Sending In Django not working

Google hast stopped less secure apps, so u cant send email messages anymore 
with ur email and password, U will have to find some other way of sending mails.

On Wed, 9 Nov, 2022, 16:26 peteru mimo, 
mailto:peterumi...@gmail.com>> wrote:
Good day team,

I have been facing this challenge in sending mail in django

here is the error "A connection attempt failed because the connected party did 
not properly respond after a period of time, or established connection failed 
because connected host has failed to respond"

Code
def send_verification_email(request, user):
from_email = settings.DEFAULT_FROM_EMAIL
current_site = get_current_site(request)
mail_subject = 'Please activate your account'
message = 
render_to_string('accounts/emails/account_verification_email.html', {
'user': user,
'domain': current_site,
'uid': urlsafe_base64_encode(force_bytes(user.pk<http://user.pk>)),
'token': default_token_generator.make_token(user),
})
to_email = user.email
mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
mail.send()

Settings
EMAIL_HOST = 'smtp.google.com<http://smtp.google.com>'
EMAIL_POST = '587'
EMAIL_HOST_USER = 'myemail'
EMAIL_HOST_PASSWORD = 'email_password'
EMAIL_USE_TLS = True

Any solution will be appreciated. Thank you


--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com<https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com?utm_medium=email_source=footer>.

--
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com?utm_medium=email_source=footer>.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AS8P193MB1158CD635697F8E3E8596FF0AE3E9%40AS8P193MB1158.EURP193.PROD.OUTLOOK.COM.


Re: Email Sending In Django not working

2022-11-09 Thread Lakshyaraj Dash
Even if Google has stopped the support, emails can be still sent using two
step verification and generating app passwords after enabling two step
verification. Please update you email password with the generated app
password.

Steps:
1. Go to manage my Google account
2. Go to security tab
3. Enable two step verification and verify yourself
4. Create your app passwords after the app passwords in the security
settings is visible
5. Select the app name (or add your custom app name) and click generate.
6. Copy the app password as it's view once and cannot be viewed after the
pop up is closed.
7. Go to your settings.py file and replace your actual email password with
the generated app password.

Yay! You're all set.

Dear It's Alladin, please try this also to the one who asked this question
please try it once.

Thanks and Regards
Lakshyaraj Dash

On Wed, Nov 9, 2022, 20:57 It's Aladdin  wrote:

> Google hast stopped less secure apps, so u cant send email messages
> anymore with ur email and password, U will have to find some other way of
> sending mails.
>
> On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:
>
>> Good day team,
>>
>> I have been facing this challenge in sending mail in django
>>
>> here is the error *"A connection attempt failed because the connected
>> party did not properly respond after a period of time, or established
>> connection failed because connected host has failed to respond"*
>>
>> *Code*
>> def send_verification_email(request, user):
>> from_email = settings.DEFAULT_FROM_EMAIL
>> current_site = get_current_site(request)
>> mail_subject = 'Please activate your account'
>> message =
>> render_to_string('accounts/emails/account_verification_email.html', {
>> 'user': user,
>> 'domain': current_site,
>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>> 'token': default_token_generator.make_token(user),
>> })
>> to_email = user.email
>> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
>> mail.send()
>>
>> *Settings*
>> EMAIL_HOST = 'smtp.google.com'
>> EMAIL_POST = '587'
>> EMAIL_HOST_USER = 'myemail'
>> EMAIL_HOST_PASSWORD = 'email_password'
>> EMAIL_USE_TLS = True
>>
>> Any solution will be appreciated. Thank you
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF7qQgDgXF8_J6cJ6PsJDEuJOqxpwNd4nTLE8tAxcqthAPfmiw%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread It's Aladdin
Google hast stopped less secure apps, so u cant send email messages anymore
with ur email and password, U will have to find some other way of sending
mails.

On Wed, 9 Nov, 2022, 16:26 peteru mimo,  wrote:

> Good day team,
>
> I have been facing this challenge in sending mail in django
>
> here is the error *"A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond"*
>
> *Code*
> def send_verification_email(request, user):
> from_email = settings.DEFAULT_FROM_EMAIL
> current_site = get_current_site(request)
> mail_subject = 'Please activate your account'
> message =
> render_to_string('accounts/emails/account_verification_email.html', {
> 'user': user,
> 'domain': current_site,
> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
> 'token': default_token_generator.make_token(user),
> })
> to_email = user.email
> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
> mail.send()
>
> *Settings*
> EMAIL_HOST = 'smtp.google.com'
> EMAIL_POST = '587'
> EMAIL_HOST_USER = 'myemail'
> EMAIL_HOST_PASSWORD = 'email_password'
> EMAIL_USE_TLS = True
>
> Any solution will be appreciated. Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA5HNVoRdTC2BBZ2FEk1ETaqxfL5xKQgfBuAcbFdPES_bSRYmQ%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread Jitendra kumar Patra
Please use  int type EMAIL_PORT = 587

On Wed, 9 Nov, 2022, 16:42 peteru mimo,  wrote:

> EMAIL_PORT = '587'
>
> On Wed, Nov 9, 2022 at 11:56 AM peteru mimo  wrote:
>
>> Good day team,
>>
>> I have been facing this challenge in sending mail in django
>>
>> here is the error *"A connection attempt failed because the connected
>> party did not properly respond after a period of time, or established
>> connection failed because connected host has failed to respond"*
>>
>> *Code*
>> def send_verification_email(request, user):
>> from_email = settings.DEFAULT_FROM_EMAIL
>> current_site = get_current_site(request)
>> mail_subject = 'Please activate your account'
>> message =
>> render_to_string('accounts/emails/account_verification_email.html', {
>> 'user': user,
>> 'domain': current_site,
>> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
>> 'token': default_token_generator.make_token(user),
>> })
>> to_email = user.email
>> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
>> mail.send()
>>
>> *Settings*
>> EMAIL_HOST = 'smtp.google.com'
>> EMAIL_POST = '587'
>> EMAIL_HOST_USER = 'myemail'
>> EMAIL_HOST_PASSWORD = 'email_password'
>> EMAIL_USE_TLS = True
>>
>> Any solution will be appreciated. Thank you
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJBAA1Ls4VT_ZywWYz4NE1w3YX-xtw85mzMKk7cTwwBgQe5j0w%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOAROfk4gAwfJeiwV5eOHAD%2BRtLa%3D6vRG7UU0ay4Hwgde-GnDA%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread Lakshyaraj Dash
It's more likely that google is not accepting the credentials you are
providing or else the smtp server has just hung up due to several requests.

You can do it without using the django.core.mail. I've written an article
recently on dev.to
https://dev.to/codewithlaksh/how-to-send-emails-using-python-django--8c3

Follow up and hope the article helps you

Thanks and Regards
Lakshyaraj Dash


On Wed, Nov 9, 2022 at 4:25 PM peteru mimo  wrote:

> Good day team,
>
> I have been facing this challenge in sending mail in django
>
> here is the error *"A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond"*
>
> *Code*
> def send_verification_email(request, user):
> from_email = settings.DEFAULT_FROM_EMAIL
> current_site = get_current_site(request)
> mail_subject = 'Please activate your account'
> message =
> render_to_string('accounts/emails/account_verification_email.html', {
> 'user': user,
> 'domain': current_site,
> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
> 'token': default_token_generator.make_token(user),
> })
> to_email = user.email
> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
> mail.send()
>
> *Settings*
> EMAIL_HOST = 'smtp.google.com'
> EMAIL_POST = '587'
> EMAIL_HOST_USER = 'myemail'
> EMAIL_HOST_PASSWORD = 'email_password'
> EMAIL_USE_TLS = True
>
> Any solution will be appreciated. Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAF7qQgDsWQiDUyYuxNHDz5%2BWteJ%3DMF_6VbtrYoAQo_v4KhEjPA%40mail.gmail.com.


Re: Email Sending In Django not working

2022-11-09 Thread peteru mimo
EMAIL_PORT = '587'

On Wed, Nov 9, 2022 at 11:56 AM peteru mimo  wrote:

> Good day team,
>
> I have been facing this challenge in sending mail in django
>
> here is the error *"A connection attempt failed because the connected
> party did not properly respond after a period of time, or established
> connection failed because connected host has failed to respond"*
>
> *Code*
> def send_verification_email(request, user):
> from_email = settings.DEFAULT_FROM_EMAIL
> current_site = get_current_site(request)
> mail_subject = 'Please activate your account'
> message =
> render_to_string('accounts/emails/account_verification_email.html', {
> 'user': user,
> 'domain': current_site,
> 'uid': urlsafe_base64_encode(force_bytes(user.pk)),
> 'token': default_token_generator.make_token(user),
> })
> to_email = user.email
> mail = EmailMessage(mail_subject, from_email, message, to=[to_email])
> mail.send()
>
> *Settings*
> EMAIL_HOST = 'smtp.google.com'
> EMAIL_POST = '587'
> EMAIL_HOST_USER = 'myemail'
> EMAIL_HOST_PASSWORD = 'email_password'
> EMAIL_USE_TLS = True
>
> Any solution will be appreciated. Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1ed5b9fc-3370-413c-b4cb-edeb2451d8f4n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJBAA1Ls4VT_ZywWYz4NE1w3YX-xtw85mzMKk7cTwwBgQe5j0w%40mail.gmail.com.