0

I am trying to build a prototype in python. The used case is fairly simple. Upon running the program will accept an input x and will execute something like

if(x<=3){
  send email to xxx@gmail.com
  some html copy
} 

This is the start...Now I think I would need a web server to send an email. And that's where I getting lost. Can I avoid installing a server stack for this task? I am pretty new to python.

soum
  • 1,131
  • 3
  • 20
  • 47
  • You need to be more specific in order to get helpful answers. – Maroun Oct 26 '14 at 16:33
  • 1) You don't need a web server to send email, you need access to an email server. 2) You tagged this question Python, but provided code in Java / C#. – Larry Lustig Oct 26 '14 at 16:40

1 Answers1

1

Directly sending email from your own computer will often fail, as email systems routinely block all emails from unknown sources, as an anti-spam measure. So it would normally be best to use an email service such as gmail.

Google has an api for python to interact with gmail, and this allows for the sending of emails.

You would need to install with

pip install --upgrade google-api-python-client

and be sure to read, consider and inwardly digest the documentation, especially regarding authentication

https://developers.google.com/gmail/api/overview#api_overview

James K
  • 3,692
  • 1
  • 28
  • 36