How To Send Email With Django - Python Django Dentist Website #7

  Рет қаралды 85,373

Codemy.com

Codemy.com

Күн бұрын

In this video we'll learn how to send email from a Django app. I'll show you two ways to do it (with a debugging server and with an actual email provider).
Most websites you create will have a contact page with a form for people to send you email. In this video I'll show you how to process that form and send actual email.
Sending Mail with Django is actually pretty easy!

Пікірлер: 204
@Codemycom
@Codemycom 4 жыл бұрын
UPDATE: You may have to set the email port without quotes.... EMAIL_PORT = 587
@raspberry9417
@raspberry9417 4 жыл бұрын
how about port 465, do you have demos?
@SaeedAlFalasi
@SaeedAlFalasi 4 жыл бұрын
that explained ! thank you :D
@ilungantita8419
@ilungantita8419 3 жыл бұрын
Thanks a lot, really helped
@killcam8071
@killcam8071 2 жыл бұрын
Traceback (most recent call last): File "C:\arshia\Website\manage.py", line 22, in main() File "C:\arshia\Website\manage.py", line 18, in main execute_from_command_line(sys.argv) File "C:\arshia\Website\lib\site-packages\django\core\management\__init__.py", line 425, in execute_from_command_line utility.execute() File "C:\arshia\Website\lib\site-packages\django\core\management\__init__.py", line 419, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\arshia\Website\lib\site-packages\django\core\management\base.py", line 373, in run_from_argv self.execute(*args, **cmd_options) File "C:\arshia\Website\lib\site-packages\django\core\management\base.py", line 417, in execute output = self.handle(*args, **options) File "C:\arshia\Website\lib\site-packages\django\core\management\commands\sendtestemail.py", line 29, in handle send_mail( File "C:\arshia\Website\lib\site-packages\django\core\mail\__init__.py", line 61, in send_mail return mail.send() File "C:\arshia\Website\lib\site-packages\django\core\mail\message.py", line 284, in send return self.get_connection(fail_silently).send_messages([self]) File "C:\arshia\Website\lib\site-packages\django\core\mail\backends\smtp.py", line 102, in send_messages new_conn_created = self.open() File "C:\arshia\Website\lib\site-packages\django\core\mail\backends\smtp.py", line 69, in open self.connection.login(self.username, self.password) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64__qbz5n2kfra8p0\lib\smtplib.py", line 750, in login raise last_exception File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64__qbz5n2kfra8p0\lib\smtplib.py", line 739, in login (code, resp) = self.auth( File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.2800.0_x64__qbz5n2kfra8p0\lib\smtplib.py", line 662, in auth raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at 5.7.8 support.google.com/mail/?p=BadCredentials e22-20020a170906505600b006da7d71f25csm1152188ejk.41 - gsmtp')
@killcam8071
@killcam8071 2 жыл бұрын
help me please
@adrianm.zapata6644
@adrianm.zapata6644 2 ай бұрын
Nice to have a young Walter White explaining these kind of things. Greetings from Chile.
@Codemycom
@Codemycom 2 ай бұрын
Ha!
@adrianm.zapata6644
@adrianm.zapata6644 2 ай бұрын
@@Codemycom haha thanks!
@Codemycom
@Codemycom 4 жыл бұрын
▶️ Watch Entire Money Making Playlist ✅ Subscribe To My KZfaq Channel: bit.ly/2tEBTzg bit.ly/2IGzvOR ▶️ See More At: ✅ Join My Facebook Group: Codemy.com bit.ly/2GFmOBz ▶️ Learn to Code at Codemy.com Take $30 off with coupon code: youtube1
@vijaykumarkarnan5223
@vijaykumarkarnan5223 4 жыл бұрын
your way of explanation is too good. please upload more videos.
@mshoaib6106
@mshoaib6106 4 жыл бұрын
Excellent , Most Fav Instructor ever. LOVE YOU.:)
@Codemycom
@Codemycom 4 жыл бұрын
Thanks!
@grayfaux_
@grayfaux_ Жыл бұрын
Less secure apps is no longer supported by Google. You need to enable 2 factor and set an app password in the google account. This way your email is not compromised by allowing less secure apps.
@lissankoirala
@lissankoirala 4 жыл бұрын
Thanks for this wonderful video sir, really helpful!
@Codemycom
@Codemycom 4 жыл бұрын
Glad it was helpful!
3 жыл бұрын
thanks man, very helpful video. keep up the good work.
@Codemycom
@Codemycom 3 жыл бұрын
Glad you enjoyed it!
@abdullahhazari918
@abdullahhazari918 3 жыл бұрын
I love you men you solve my problem with google ! :D
@ai.201
@ai.201 4 жыл бұрын
Thanks Sir. You are doing great job.
@Codemycom
@Codemycom 4 жыл бұрын
Thanks :-)
@gamingzonebk5943
@gamingzonebk5943 3 жыл бұрын
Really helped me great thanks for the video
@Codemycom
@Codemycom 3 жыл бұрын
Sure thing!
@nowyouknow2249
@nowyouknow2249 4 жыл бұрын
Thanks It was really helpful
@Codemycom
@Codemycom 4 жыл бұрын
Awesome, glad it was helpful!
@technologybysrk8419
@technologybysrk8419 Жыл бұрын
Thank you for what you do for us
@Codemycom
@Codemycom Жыл бұрын
Welcome
@ameerhbaig
@ameerhbaig 4 жыл бұрын
Thanks for this tutorial :)
@Codemycom
@Codemycom 4 жыл бұрын
You're welcome!
@bfarhan8
@bfarhan8 3 жыл бұрын
Ok, I start hating Django yesterday and was thinking about a career change, but now i am saying Django is awesome :D
@informativecontent4778
@informativecontent4778 3 жыл бұрын
I made my final yr project via djangi
@Codemycom
@Codemycom 3 жыл бұрын
awesome
@Codemycom
@Codemycom 3 жыл бұрын
nice
@troyforrester1991
@troyforrester1991 3 жыл бұрын
Respect for this one
@Codemycom
@Codemycom 3 жыл бұрын
Thanks
@user-sv2tx7nv3m
@user-sv2tx7nv3m 3 жыл бұрын
Thank you very much!!
@Codemycom
@Codemycom 3 жыл бұрын
You're welcome!
@sameergaikwad1885
@sameergaikwad1885 3 жыл бұрын
Thanks... Video Helps :)
@Codemycom
@Codemycom 3 жыл бұрын
Glad it helped
@sabinkatwal8185
@sabinkatwal8185 4 жыл бұрын
Thank you sir.
@Codemycom
@Codemycom 4 жыл бұрын
You're welcome!
@ricardofernandez2286
@ricardofernandez2286 2 жыл бұрын
Hi, thank you very much for these great tutorials! On this particular one I'm getting a couple of deprecation messages: C:\Python\lib\smtpd.py:105: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio import asyncore C:\Python\lib\smtpd.py:106: DeprecationWarning: The asynchat module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio import asynchat How do you think we should transition from this solution to one that uses the new suggested library? Thank you very much! Warm regards Ricardo
@rootuser5652
@rootuser5652 3 жыл бұрын
i watched this video exactly one year AFTER the release lol. PS. google security is better than.. nevermind haha NICE VIDEO!
@Codemycom
@Codemycom 3 жыл бұрын
Ha nice
@rangabharath4253
@rangabharath4253 4 жыл бұрын
Thank you so much
@Codemycom
@Codemycom 4 жыл бұрын
You're very welcome!
@engaligamalengaligamal
@engaligamalengaligamal 3 жыл бұрын
Thanks... Video Helps :) can you used map google in django
@apex4462
@apex4462 2 жыл бұрын
when i am using the request.POST method for name and other details like email, it doesn't get any value for the placeholder.
@J2LProductions
@J2LProductions 4 жыл бұрын
Everything works great! Awesome tutorial!! The only problem I have is that when someone sends me an email, the email sender is my own and doesn't show me the email that they typed in the email input. My code is exactly like yours.
@Codemycom
@Codemycom 4 жыл бұрын
Are you sure it's exactly the same?
@bektursunsamatuulu9772
@bektursunsamatuulu9772 4 жыл бұрын
Hi? Did you fix your problem? It seems like, the same problem that I am having now.
@R3N3C3K
@R3N3C3K 4 жыл бұрын
All of us have the same problem. I believe all of us are using the google smtp server and that will be the most probable problem... I believe Codemy's code works in the console. But when you switch to the google smtp, then the sender is the EMAIL_HOST_USER and not the email set in the form. Following code can redirect all information into message body. Unfortunately, I do not know how to print Full Name; Email Address; and Message fields at separate lines of the body text... :-( But I have the data. send_mail( 'message from ' + message_name, # email_subject 'Full Name: ' + message_name + '; Email Address: ' + message_email + '; Message: ' + message, # message message_email, # from email ['recepient1@example.com', 'recepient2@example.com'], # To Email ) Or we can google how to force gmail to redirect sender from EMAIL_HOST_USER to the email address value set in the form. I has not been successful yet. But I believe there is some hidden magical switcher.
@R3N3C3K
@R3N3C3K 4 жыл бұрын
I have done some review and result posted at stackoverflow. It appears it is not posible to set properly the sender via gmail smtp. But I have quite solved the problem here: stackoverflow.com/questions/61518299/django-python-email-form-is-not-forwarding-senders-email-address-via-gmail-smtp
@jenilchudgar
@jenilchudgar 2 жыл бұрын
@@R3N3C3K You can use ' '
@killcam8071
@killcam8071 2 жыл бұрын
nice job man❤❤❤
@Codemycom
@Codemycom 2 жыл бұрын
thanks!
@rubinashrestha1861
@rubinashrestha1861 3 жыл бұрын
Heyy, I did exactly the same thing as shown in the video but for some reason I am getting an error saying SMTPServerDisconnected. I have tried finding solution to the problem everywhere but I don't seem to find it.
@karthikkumarmv9101
@karthikkumarmv9101 3 жыл бұрын
Sir I want send more input tag data at the place of massage in send mail function (I mean msg1,msg2...etc)wt should I want to do
@I_Follow_Jesus
@I_Follow_Jesus 4 жыл бұрын
Thanks!
@Codemycom
@Codemycom 4 жыл бұрын
Sure thing!
@alialavizadeh2775
@alialavizadeh2775 3 жыл бұрын
that was great, tnx
@Codemycom
@Codemycom 3 жыл бұрын
thanks!
@alimomeni3535
@alimomeni3535 3 жыл бұрын
gooood , nice
@Codemycom
@Codemycom 3 жыл бұрын
Thanks!
@alexdin1565
@alexdin1565 2 жыл бұрын
please can you add an email tracker to check when receiver open URL
@Codemycom
@Codemycom 2 жыл бұрын
No
@rahulrajeev9879
@rahulrajeev9879 9 ай бұрын
🔥poli sanam 💫
@Shamir-qb1ih
@Shamir-qb1ih Ай бұрын
Malayaliyaa😂
@FarhatJahan
@FarhatJahan 4 жыл бұрын
Hi, this video was really helpful. But I am facing one problem, i have app password and gmail account along with 2 factor authentication, but the received mail TO and FROM showing the same email id i.e. my own emial id. But when i tried with DebbungingServer everything was as expected.
@FarhatJahan
@FarhatJahan 3 жыл бұрын
I have understood why we should not be using user's email address in from field: stackoverflow.com/questions/62620601/to-and-from-return-the-same-email-id-in-django-send-mail
@deadandgone70
@deadandgone70 3 жыл бұрын
The two factor authentication one works but the less secure app way doesn't as of November 2020
@esspi9
@esspi9 3 жыл бұрын
Hey! Was this a part of any playlist? It says #7, but I couldn't find a django dentist playlist on your channel.
@Codemycom
@Codemycom 3 жыл бұрын
Link in the comment section: bit.ly/2tEBTzg
@avishekthapa1774
@avishekthapa1774 3 жыл бұрын
in the send_mail function what is the point of writing message_email since the email we get is from the email we set in the settings files?? and also why does it work like this?
@zekafarzali6816
@zekafarzali6816 3 жыл бұрын
exactly, I was so confused why I receive an email from myself. Then it kicked in, it doesn't look right)
@raunakghawghawe4921
@raunakghawghawe4921 2 жыл бұрын
Got this error, please help : [WinError 10060] 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
@joudalshuaibi2712
@joudalshuaibi2712 3 жыл бұрын
Hello, Thank you for your amazing videos. I have one question, I sent an HTML Email through Django but i need to take the users (who receives the email)'s response ( it's either Accept or reject through Radio button). how can i take the response in any way . I'm open to all solutions. Thank you in advance.
@valoranthighlights7901
@valoranthighlights7901 2 жыл бұрын
hey bro i want to do this same thing can you guide me further
@Kruiger1993
@Kruiger1993 2 жыл бұрын
Great video in general just bummer that you didn’t show how it looks like in the html file
@Codemycom
@Codemycom 2 жыл бұрын
what html file?
@bastiantokusumajaya4337
@bastiantokusumajaya4337 2 жыл бұрын
Is it better to use commercial email like gmail etc or it is better to setup our own mail server like using postfix?
@Codemycom
@Codemycom 2 жыл бұрын
better in what way?
@hetshah7743
@hetshah7743 3 жыл бұрын
[Errno 11003] getaddrinfo failed I am getting this error, even after importing socket in settings.py Any solutions ?
@fakeavangchhia3131
@fakeavangchhia3131 Жыл бұрын
Hello John! I really appreciate for all your tutorials but I am having a problem that the template I am using on my website does not have a contact.html instead it's have contact.php in forms how will i use this php forms can i please get help
@Codemycom
@Codemycom Жыл бұрын
There might be some way to hack it, but I wouldn't know it. PHP doesn't work with Django.
@ange-dev854
@ange-dev854 Жыл бұрын
thanks sir for that but now i can't send email i got error smtpauthenticationerror and i can't turn on less secure app please help me
@eugenekwaka
@eugenekwaka 4 жыл бұрын
When I run the code in the browser at 11:24 I get a 'UnicodeError at /Contact.html/ encoding with 'idna' codec failed(UnicodeError: label empty or too long) ' I wonder what the problem is
@caelim3524
@caelim3524 3 жыл бұрын
same I did some googling and it appears to be an error with windows. I couldn't find a fix
@AntonioOrdaz1
@AntonioOrdaz1 4 жыл бұрын
Is it better to do it with CBV?
@Codemycom
@Codemycom 4 жыл бұрын
Not better, just different.
@LAEC91
@LAEC91 3 жыл бұрын
Sad but true. Not many people have 2FA turned on.
@muhammadhassanbutt9305
@muhammadhassanbutt9305 3 жыл бұрын
plz share what is in your model.py
@nafiyad1950
@nafiyad1950 3 жыл бұрын
What is your django version
@Codemycom
@Codemycom 3 жыл бұрын
Not the latest version
@user-oq3np1ud8q
@user-oq3np1ud8q 4 жыл бұрын
Hi! I know that with django it's possible to send several email's at once from site. Can you explaine ho to do it? or maybe even make special video?!
@Codemycom
@Codemycom 4 жыл бұрын
I'm not going to do a video on that because people will just use it to spam. But you can read the Django Docs yourself: docs.djangoproject.com/en/3.0/topics/email/#send-mass-mail
@SaeedAlFalasi
@SaeedAlFalasi 4 жыл бұрын
If anyone has errors using the send_mail() function you have to pass the arguments in the exact order send_mail(subject, message, from_email, recipient_list) I ended up concatenating message_name with message_subject and message_email with message_phonenumber as i required the persons phone number.
@Codemycom
@Codemycom 4 жыл бұрын
interesting
@psicologiaobversa
@psicologiaobversa 3 жыл бұрын
I have this error with send_mail( And: Exception value: SMTP AUTH extension not supported by server I’m using: message_subject, message, message_email, [myemail@email.com], ) I have changed the order several times and still got error on that.
@SaeedAlFalasi
@SaeedAlFalasi 3 жыл бұрын
@@psicologiaobversa the error says the server is not accepting the authentication or its unsupported
@psicologiaobversa
@psicologiaobversa 3 жыл бұрын
Any idea on that?
@alexx1466
@alexx1466 Жыл бұрын
please make a video of how to connect to databases . i have the error of database coneccion error
@Codemycom
@Codemycom Жыл бұрын
I have tons of videos on that on my channel.
@hibas7568
@hibas7568 4 жыл бұрын
hi :) I have 'phone number ' on my contact form..but im not able to send it through send_mail. Is there any other way to send mail where i can add other parameters i want?
@dmytrozimin7240
@dmytrozimin7240 4 жыл бұрын
Maybe you can try to put it to the message by concatenating it, thus you would get the mobile number inside the message. Just an idea:)
@thinhtran7268
@thinhtran7268 2 жыл бұрын
SMTP AUTH extension not supported by server. Help me, please
@investandcyclecheap4890
@investandcyclecheap4890 2 жыл бұрын
same issue, did you have any success?
@amanjain6680
@amanjain6680 3 жыл бұрын
Why do i alway get connectionAbortedError?
@diptabarman5756
@diptabarman5756 3 жыл бұрын
it is not working after deploying
@srivallisb2309
@srivallisb2309 4 жыл бұрын
Hi, I liked this video, but I wanted to know how to send reminder emails at a specific time. Can you help me out?
@pranavrawlani111
@pranavrawlani111 3 жыл бұрын
you have to use cron jobs with it
@pranavrawlani111
@pranavrawlani111 3 жыл бұрын
kzfaq.info/get/bejne/a9CReLaHsNe5o2g.html this link should help
@tudordraghici6154
@tudordraghici6154 3 жыл бұрын
Hei Jon, I have a question. I still did not manage to send an email. Some time passed and nothing happens. Can you please give me a hand over here ? PS. Great job, please keep up the good work you've done
@tudordraghici6154
@tudordraghici6154 3 жыл бұрын
Did anyone have this issue as well ?
@okami5365
@okami5365 3 жыл бұрын
So Im stuck on something it could bea really dumb little thing that I am stuck on but I can't seem to grasp how you kept the local:8000 and the local:1025 at the same time and when I make two two git bashes for each I get a error for the localhost:8000? what should I do?
@Codemycom
@Codemycom 3 жыл бұрын
The two things shouldn't have anything to do with each other. What;s the error?
@okami5365
@okami5365 3 жыл бұрын
@@Codemycom the error shows that send_mail( has a problem ^
@okami5365
@okami5365 3 жыл бұрын
@@Codemycom I tried everything and it still doesn't work 😥
@ryan_0337
@ryan_0337 4 жыл бұрын
Thanks for the video. Do you know how we could send a text in a phone number in what app ? Morover, I smashed the like button since I saw the video
@Codemycom
@Codemycom 4 жыл бұрын
Thanks for smashing the like button! It's my favorite thing. Yes you can send a text message, but it's too complicated to talk about here...maybe I'll do a video on it later.
@ryan_0337
@ryan_0337 4 жыл бұрын
@@Codemycom ok and are you going to explain how to deploy the app ?
@Codemycom
@Codemycom 4 жыл бұрын
@@ryan_0337 yes
@SaeedAlFalasi
@SaeedAlFalasi 4 жыл бұрын
@@ryan_0337 Look at Amazon SNS service for SMS texts, whatsapp you would prob need to register a business account with them im sure they have documentations on it
@SaeedAlFalasi
@SaeedAlFalasi 4 жыл бұрын
@@Codemycom I seen an whatsapp python API using twilio but havent messed around with it yet. i couldnt find any other python whatsapp for business APIs
@mohitkothari3300
@mohitkothari3300 3 жыл бұрын
my command prompt showed me details of the email but I haven't received it. So the module worked but only 50%
@Codemycom
@Codemycom 3 жыл бұрын
Yeah it's a hacky sort of thing...
@AnnoyingErrors41
@AnnoyingErrors41 3 жыл бұрын
Production version at 14:37
@Codemycom
@Codemycom 3 жыл бұрын
ok
@AnnoyingErrors41
@AnnoyingErrors41 3 жыл бұрын
@@Codemycom LOL, just for people looking for a quick fix. No taunts!
@ram_qr
@ram_qr Ай бұрын
👍👍👍👍👍
@Codemycom
@Codemycom Ай бұрын
:-)
@delllatitude299
@delllatitude299 4 жыл бұрын
awesome video. i have a quick question. how many emails we can add into SentToEmail List .
@Codemycom
@Codemycom 4 жыл бұрын
you can't use them to send spam, if that's what you're asking. docs.djangoproject.com/en/3.0/topics/email/#send-mass-mail
@delllatitude299
@delllatitude299 4 жыл бұрын
@@Codemycom kind of. basically i want to send mulitple emails to different peoples at a time. we can use loop or something iterations. but i want to know the best practice to do this so we can avoid to send mails in spam folder. I hope you got my point.
@Codemycom
@Codemycom 4 жыл бұрын
@@delllatitude299 Yeah, check that link I posted...that's the django docs for sending multiple emails...
@delllatitude299
@delllatitude299 4 жыл бұрын
@@Codemycom thanks. really appreciated your quick response. Please keep posting good content.
@Codemycom
@Codemycom 4 жыл бұрын
@@delllatitude299 Will do!
@AnilThapa-jx1fc
@AnilThapa-jx1fc 4 жыл бұрын
Hello Sir All This Worked Perfectly But only problem i didnt recieved mail
@Codemycom
@Codemycom 4 жыл бұрын
Hm...
@sanketkumar_coder
@sanketkumar_coder Жыл бұрын
Google doesn't use less secure apps anymore, what are the alternatives?
@rcitaku1704
@rcitaku1704 5 ай бұрын
Hello, you probably dont need this anymore but for anyone who does, you go to Security in your gmail account, then enable 2FA (2 factor authentication) and then you make an app password, copy it and paste it in the settings email password and thats about it! Hope this helped!
@sanketkumar_coder
@sanketkumar_coder 4 ай бұрын
@@rcitaku1704 I also figured it out . thanks :)
@jakezimmerman9822
@jakezimmerman9822 3 жыл бұрын
I have this working locally, but for some reason, I get an SMTPAuthentication error when trying to deploy on heroku. Anyone else have this issue?
@jakezimmerman9822
@jakezimmerman9822 3 жыл бұрын
I decided to use mailgun instead of django's send mail function and it worked. Pretty much a copy/paste replacement. documentation.mailgun.com/en/latest/quickstart-sending.html#send-via-api Also, I wasn't installing my dependencies to my virtual env with pipenv install, and was seeing a bunch of ModuleNotFound errors.
@mahdidaoud
@mahdidaoud 2 жыл бұрын
maybe the error because you didn't set the .env in geroku itself
@R3N3C3K
@R3N3C3K 4 жыл бұрын
In comments under the video, many people mentioned that gmail is not forwarding sender's email address. Here is designed method how I have bipassed the issue and have got all dynamic content into the message: stackoverflow.com/questions/61518299/django-python-email-form-is-not-forwarding-senders-email-address-via-gmail-smtp
@samucancld
@samucancld Жыл бұрын
i can't believe is that fucking easy
@fustigate8933
@fustigate8933 2 жыл бұрын
the thumbnail...your right hand...
@Codemycom
@Codemycom 2 жыл бұрын
What about it?
@tamiltechguyz7264
@tamiltechguyz7264 3 жыл бұрын
Sir I am following all your videos but request to share ne the roles and permission access to templates in decorators
@Codemycom
@Codemycom 3 жыл бұрын
What are you talking about? There's nothing to share
@tamiltechguyz7264
@tamiltechguyz7264 3 жыл бұрын
@@Codemycom share me the decorator tutorials on django
@Shivam-sf5im
@Shivam-sf5im 13 күн бұрын
hi sir what is the Windows equivalent command for this --->> python -m smtpd -n -c DebuggingServer localhost:1025 Does this still work ??
@Codemycom
@Codemycom 12 күн бұрын
huh?
@Shivam-sf5im
@Shivam-sf5im 12 күн бұрын
thanks I GOT itt..
@bektursunsamatuulu9772
@bektursunsamatuulu9772 4 жыл бұрын
Thank you for the videos. I appreciate it. I have one question to make sure. Now, I am using the second way of sending an email. My question when users fill out the form Get In Touch, I am receiving an email to my account but I have no idea who is sending it. How can I know who filled out the form? I want to know person's email for a reply to him/her later, as it says, - "We received your email and will respond shortly..." Somehow, I need to know an email of the user in order to reply back. Right? Looking forward to your reply. Thanks again.
@Codemycom
@Codemycom 4 жыл бұрын
Didn't I cover that in the video?
@bektursunsamatuulu9772
@bektursunsamatuulu9772 4 жыл бұрын
@@Codemycom Do you mean this one, 4:44 ? Here is my code: def contact_us(request): if request.method == 'POST': message_name = request.POST.get('message-name') message_email = request.POST.get('message-email') message = request.POST.get('message') # send an email send_mail( message_name, # subject message, # message message_email, # from email ['example@gmail.com'], # To Email ) return render(request, 'dent/contact.html', {'message_name': message_name}) return render(request, 'dent/contact.html', {}) What's wrong?
@bektursunsamatuulu9772
@bektursunsamatuulu9772 4 жыл бұрын
Updated. No need to reply. Thanks.
@suhanisinha21
@suhanisinha21 4 жыл бұрын
@@bektursunsamatuulu9772 hey! I am still not receiving the email of the person filling out the form. How did you get it? Please help.
@bektursunsamatuulu9772
@bektursunsamatuulu9772 4 жыл бұрын
@@suhanisinha21 heeey sorry for late.. Is it works now?
@anandsarank
@anandsarank 3 жыл бұрын
Hi, Can anyone help me with this. I am getting - Exception Type: OSError at /contact.html Exception Value: Int or String expected
@bfarhan8
@bfarhan8 3 жыл бұрын
Try Stackoverflow
@scottnorman2485
@scottnorman2485 2 жыл бұрын
Love your videos, but this error keeps ocurring... ConnectionRefusedError [WinError 10061] No connection could be made because the target machine actively refused it
@ahmeterkalkan8701
@ahmeterkalkan8701 Жыл бұрын
same, did u fix it?
@dropdeaddavi440
@dropdeaddavi440 Жыл бұрын
As of May 2022 Gmail no longer supports less secure app access, leaving this comment here in case there's an updated way of doing this
@janicesombillo8147
@janicesombillo8147 4 жыл бұрын
why is that when i send email the sender is always the receiver?
@Codemycom
@Codemycom 4 жыл бұрын
because that's how you set it up in your code.
@janicesombillo8147
@janicesombillo8147 4 жыл бұрын
But my code is exactly like yours and its not showing the senders email
@janicesombillo8147
@janicesombillo8147 4 жыл бұрын
@@Codemycom please help
@Codemycom
@Codemycom 4 жыл бұрын
@@janicesombillo8147 Just look at the code, you must have the same email twice...right? That's not correct if you want to send email to two different email addresses...
@janicesombillo8147
@janicesombillo8147 4 жыл бұрын
@@Codemycom the problem is it doesnt show the senders email
@investandcyclecheap4890
@investandcyclecheap4890 2 жыл бұрын
Im getting a depreciated warning when running DebuggingServer . Is anyone else getting this? I havent been able to receive an email from my localhost yet... $ python -m smtpd -n -c DebuggingServer localhost:1025 C:\Users\...\AppData\Local\Programs\Python\Python310\lib\smtpd.py:104: DeprecationWarning: The asyncore module is deprecated. The recommended replacement is asyncio import asyncore C:\Users\...\AppData\Local\Programs\Python\Python310\lib\smtpd.py:105: DeprecationWarning: The asynchat module is deprecated. The recommended replacement is asyncio import asynchat
@Codemycom
@Codemycom 2 жыл бұрын
No clue...but you can always just try to do what it says and see what happens.
@alexandra.thegreat
@alexandra.thegreat 2 жыл бұрын
I'm having the same issue. Have you managed to solve it? thanks ;-)
@yusufyahya955
@yusufyahya955 3 жыл бұрын
raise SMTPServerDisconnected('please run connect() first') if you had this error you my be want install this : pip install django-smtp-ssl this one to istall library smtp and ssl protokol
@manpatel783
@manpatel783 3 жыл бұрын
That's not a smpt actually it is smpts
@ravindrakumara.
@ravindrakumara. 2 жыл бұрын
still had same error, afeter added pip install django-smtp-ssl
@rohit45kashyap
@rohit45kashyap 4 жыл бұрын
When i m sending mail it always send From : setting.py file email address (EMAIL_HOST_USER) To: views.py recipient list Then what is mean of taking user email id The mail should go from User Email Id to recipent list. So what should i do? Please help
@francescoguaiana4820
@francescoguaiana4820 4 жыл бұрын
have you solved this issue?
@AnilThapa-jx1fc
@AnilThapa-jx1fc 4 жыл бұрын
Keep EMAIL_HOST_USER = '' field Empty
@imtiyazahamedchowdhury2822
@imtiyazahamedchowdhury2822 3 жыл бұрын
Please help ! i set same things in my local host its working but after upload its not working from hosting . no massage send from account . so what i have to change in setting when i upload project in real hosting ?
@saxophone69
@saxophone69 2 жыл бұрын
disappointing not to have been able to see this work
@Codemycom
@Codemycom 2 жыл бұрын
you did see this work, and then you commented on it...?
@bourki-dev8014
@bourki-dev8014 3 жыл бұрын
this dosnt work pff
@Codemycom
@Codemycom 3 жыл бұрын
It doesn't work if you mess it up
@dailypythontests
@dailypythontests Жыл бұрын
great tutorial John, but I didn't see you utilize this: EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' I think it's really important
@Codemycom
@Codemycom Жыл бұрын
why would you think that?
Extends Base.html For Navbars - Python Django Dentist Website #8
17:35
Django tutorial - sending email in gmail from HTML contact form
28:11
Scottish Coder
Рет қаралды 19 М.
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 54 МЛН
Must-have gadget for every toilet! 🤩 #gadget
00:27
GiGaZoom
Рет қаралды 12 МЛН
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 88 МЛН
Heroku Webhosting for Django - Python Django Dentist Website #12
22:28
Python Django Images - How to Upload & Display Images
12:55
Dave Gray
Рет қаралды 7 М.
Send emails with Django and Amazon SES
37:41
Cloud With Django
Рет қаралды 8 М.
Django Contact Form | How To Send Email Using Django? | Tutorial 2022
17:31
Python Django Forms tutorial
26:54
Dave Gray
Рет қаралды 6 М.
How To Add Database Forms To A Web Page - Django Wednesdays #7
28:24
Sending Emails in Django With Celery
23:20
Pretty Printed
Рет қаралды 77 М.
How does HTTPS work? What's a CA? What's a self-signed Certificate?
11:02
Contact Pages in Django - Python Django Dentist Website #6
15:54
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 54 МЛН