GithubHelp home page GithubHelp logo

qoda / python-mailer Goto Github PK

View Code? Open in Web Editor NEW
100.0 100.0 70.0 15 KB

Send bulk html emails from the commandline or in your python script by specifying a database of recipients in csv form, a html template with var placeholders and a subject line.

License: BSD 3-Clause "New" or "Revised" License

Python 97.15% HTML 2.85%

python-mailer's People

Contributors

qoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

python-mailer's Issues

HTML encoding special chars

When sending a HTML formatted email with the variable and inserting a name containing international characters the characters are not displayed correctly (like: ó becomes ó and ö becomes ö).

This can be fixed by altering the source code and modify the mail header sent with python-mailer.
Change line 128 from: email_message.add_header('Content-Type', 'text/html')
To: email_message.add_header('Content-Type', 'text/html; charset="utf-8"')

Can you please fix this?

Error pymailer.send_test()

Trying this out on localhost and running into errors, thought the error is my firewall so I changed network and tried but always throws

ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

Here's the trace:

Traceback (most recent call last):
  File "C:/Users/users/PycharmProjects/python-mailer/app.py", line 5, in <module>
    pymailer.send_test()
  File "C:\Users\users\PycharmProjects\python-mailer\pymailer.py", line 221, in send_test
    self.send(recipient_list=config.TEST_RECIPIENTS)
  File "C:\Users\users\PycharmProjects\python-mailer\pymailer.py", line 203, in send
    smtp_server = smtplib.SMTP(host=config.SMTP_HOST, port=config.SMTP_PORT)
  File "c:\python36\Lib\smtplib.py", line 251, in __init__
    (code, msg) = self.connect(host, port)
  File "c:\python36\Lib\smtplib.py", line 335, in connect
    self.sock = self._get_socket(host, port, self.timeout)
  File "c:\python36\Lib\smtplib.py", line 306, in _get_socket
    self.source_address)
  File "c:\python36\Lib\socket.py", line 722, in create_connection
    raise err
  File "c:\python36\Lib\socket.py", line 713, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

Not working

You are about to send a test mail to all recipients as specified in config.py. Do you want to continue (yes/no)? y
Aborted.

can't send email with attachment python3

File "/home/test/jenkins/workspace/qa.test-migrate-to-python3/wrapper/wrapper_utils/MailerService.py", line 29, in send_report_via_email
self.email_sender.send(self.message)
File "/home/test/venv/lib/python3.4/site-packages/mailer.py", line 124, in send
self._send(server, m)
File "/home/test/venv/lib/python3.4/site-packages/mailer.py", line 161, in _send
server.sendmail(me, you, msg.as_string())
File "/home/test/venv/lib/python3.4/site-packages/mailer.py", line 242, in as_string
return self._plaintext()
File "/home/test/venv/lib/python3.4/site-packages/mailer.py", line 255, in _plaintext
return msg.as_string()
File "/usr/lib64/python3.4/email/message.py", line 159, in as_string
g.flatten(self, unixfrom=unixfrom)
File "/usr/lib64/python3.4/email/generator.py", line 112, in flatten
self._write(msg)
File "/usr/lib64/python3.4/email/generator.py", line 192, in _write
self._write_headers(msg)
File "/usr/lib64/python3.4/email/generator.py", line 219, in _write_headers
self.write(self.policy.fold(h, v))
File "/usr/lib64/python3.4/email/_policybase.py", line 314, in fold
return self._fold(name, value, sanitize=True)
File "/usr/lib64/python3.4/email/_policybase.py", line 352, in _fold
parts.append(h.encode(linesep=self.linesep,
AttributeError: 'bytes' object has no attribute 'encode'

Amazon SES

Can you please help me ...
I want to send mails using the AMAZON SES
I have credentials ready.

This doesn't work wih -s option

Hi there,

When we try to use this with -s option there's a lot of errors. I tried to fix some of them quickly just to use it. If you're interested the bugs were in the variable names in lines 161 and 162, on function validate_email used in line 151 (just removed it, as I am sure my address list is proper) and resend_failed() call on line 259 (it is called as self.resend_failed() as it should be pymailer.resend_failed(), not sure since I don't have to use it too)

Thanks for this nice piece of software and hope my contributions are worthy.

All of the best, Alexandre.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.