Checking the status of a sent email in django - python

I have a simple mail sending application which runs in python using Django. After sending an email is there a way to see if the recipient has opened it or is it still un-opened?
if so how can i do it?

The two ways to check that I know of are return receipts and checking to see if an image has been loaded. Neither is very reliable. I think the image one is the more reliable of the two, though.
You could take a pluggable app for confirming a link is being clicked, but instead of putting the link in the email, put an image in the email. This would require changing the confirm_email view to output an image (maybe an empty one).
The above library is for confirming passwords but it ought to work for checking that emails are being read, too.

You can try setting require return receipt flag on the email you are sending. But, a lot of people (I know I do) ignore that return receipt so you will never find out in those cases.
If you are asking for a 100% certain method of finding out if the recipient read his/her email, then the straight answer is: NO, you can't do that.

You have no other way than generate confirm url in your message like most sites registrations do. If person would be glad to register on your website, he will certainly click confirm at his email client of any sort. Otherwise it's a spam/scam email.
There is no way you can do it and know it's a live e-mail for sure...
Besides there are 2 other ways mentioned by my colleagues... But they are based on "unsecure" settings in old email clients rather than sure way... IMHO.

Related

What are the pros and cons of validating email address by code and by activation link. Django

In Django, during site register, input to the EmailField is validated by class EmailValidator: Link to the code.
However, this validation looks a little bit lengthy and source consuming to me. After so much checking it is still probable for a validated email address to not be in use.
Don't you think it would be much better if email-validation-by-code was totally skipped and authentication was dependent only on the activation link in terms of server resources and time. This would also provide more genuine signups/registers on the website.
Almost all webpages today send the user an activation link. It is almost inevitable for servers not to use computational power on sending emails anyway.
Is there anything that I miss about validating-by-code? Or are there any situations that activation link method would not work? What is the reason Django chose it that way? Thank you.
I think it's important to distinguish. There should be a technical check of validating if the format of an email address is correct or not. That's important to prevent technical hickups or even traffic in the very beginning. It's always great to stop as soon as possible if it's already clear in the beginning that an email is not valid.
The second thing is that you want to check wether an email address is really existent or just technically possible/in the correct format.
So in general: Yes you can validate an email address by just trying to send one validation email to your customers but that very brute forcy and you should avoid it because following technical services may experience problems.

Automatic email sending from a gmail account using script

I need to send email with same content to 1 million users.
Is there any way to do so by writing script or something?
Email Id's are stored in Excel format.
It is absolutely possible for a bot to be made that creates gmail accounts, in fact many already exist. The main problem is how to solve the captcha that is required for each new account, however there are services already built to handle this. The only problem then is being willing to violate googles terms of services, as I'm sure this does in one way or another.
This link will help you to achieve what you wanted
http://naelshiab.com/tutorial-send-email-python/

Django: Making custom permissions

So I have lots of forms that aren't attached to models, like a search form. I don't want people to be able to access these without first verifying their account through an email. How is the best way to limit their ability to do this? Is it through custom permissions? If so, how do I go about this? Thank you so much!
You have several ways to do it:
UI level: when the search field is focused you can say through an alert or other mechanism to notify users you are not allowed to search.
Server level: assuming your user is logged in or has an account you can verify the user in the search request and return a response where you state you cannot search without confirming your email.
Don't let them use the site after registering unless they confirm their email. You can see doing searches as data display and if you don't block that either you confuse users. Why can I see all articles but can't search?
I would go for 3. and let them use the site. They can confirm it afterwards when they try to do something which modifies the DB (aka they try to post something, then from a psychological standpoint there is a block between them and their objective and they will be more willing to confirm in order to achieve their objective)

How to find out if email adresses exist?

I've got a list of emails that got corrupted by some robots. On my webpage I have a box "sign in to our newsletter" that got abused with fake adresses and now I can't make up the good adresses from the fake adresses.
I would like to write a small script that check the existence of all the adresses one by one preferably without sending an email. The list isn't that long (about 300 email).
Can I do this without breaking anti-spam rules? I know that I should send an email with a link for people to verify their email but I don't really want to do this as the people with real adresses have already opted in my newsletter and they are going to wonder why I ask them to do it again.
I would ideally do this with python as this is my scripting language of choice.
Any solution to this?
I'm not sure how to do it yourself, however, there are services for this. I use Kickbox. I typically use nodejs for the server, but they have a python library Kickbox-python. You can do 100 verifications a day for free, or pay for more. I use it to verify emails when users initially sign up.
EDIT: The kickbox pricing model has changed. Now you get 100 initial verifications free, and pay for any additional verifications after that threshold. Refer to the site for the current pricing plans.

Prevent emails from Python from being flagged as spam

I've built an internal company website using Django. I have a view that sends an email to the users of the website using the send_mail() function.
Some users were not receiving emails from the site, and we fount that if they have configured Outlook to High junk-email protection level, the emails from the website are flagged as spam.
Are there any coding techniques for making an email sent from Python appear legitimate to Outlook and other email clients?
This is not really Django related problem but more about what and how you send emails, there are lots of great articles and blog posts about this topic, this is one of my favorite:
http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html
Of course you can always take a different direction and let someone else do the job for you, this will work almost certainly better that running your own smtp server. You are going to have nice stuff like stats (things like bounces, hard bounces, spam, blocks...) higher deliverabilty ...
This come with a price which in my experience will be less than the time your are going to spend to let the things run properly :)
Just to name one of those I had direct experience using MailJet with Django to handle quite big email sending (few millions per week) and it works great.
What worked for me was a simple thing that was missing. I added a "text_content" argument
(2nd from left) which was left blank before.
Also I added some text in the template in paragraph form .
msg = EmailMultiAlternatives(
subject, "Please find details of Candidate in this mail",
request.user.email,
[round_taker.email])
I know this sounds NOT so technical. But it might work for some people.

Categories

Resources