Giter VIP home page Giter VIP logo

Comments (7)

awdeorio avatar awdeorio commented on July 19, 2024

Unicode email bodies work. I haven't tried a Unicode sender name. Do you think you could provide a very small example that fails with the current implementation? Then, I can take a look at how to make it work.

from mailmerge.

bexelbie avatar bexelbie commented on July 19, 2024

see attached.

mailmerge_template.txt

mailmerge_database.csv.txt

from mailmerge.

awdeorio avatar awdeorio commented on July 19, 2024

I'm a little confused. It seems to work as expected for me:

$ mailmerge --version
mailmerge, version 1.7.6
$ mailmerge 
>>> message 0
TO: [email protected]
SUBJECT: Foo
FROM: Brian Exelbierd <[email protected]>

Hi Kristýna,


>>> sent message 0 DRY RUN
>>> Limit was 1 messages.  To remove the limit, use the --no-limit option.
>>> This was a dry run.  To send messages, use the --no-dry-run option.
$ file mailmerge_template.txt mailmerge_database.csv 
mailmerge_template.txt: ASCII text
mailmerge_database.csv: UTF-8 Unicode text
$ cat mailmerge_template.txt 
TO: {{Email}}
SUBJECT: Foo
FROM: Brian Exelbierd <[email protected]>

Hi {{Name}},

$ cat mailmerge_database.csv 
Name,Email
Kristýna,[email protected]

from mailmerge.

bexelbie avatar bexelbie commented on July 19, 2024

Please try it with some valid email addresses and send an actual message.

from mailmerge.

rupertlevene avatar rupertlevene commented on July 19, 2024

I am experiencing the same issue with UTF8 text in email bodies: the dry run succeeds, but sending email fails.

$ file mailmerge_template.txt
mailmerge_template.txt: ASCII text
$ file mailmerge_database.csv
mailmerge_database.csv: UTF-8 Unicode text
$ python --version
Python 3.5.2
$ mailmerge --version
mailmerge, version 1.7.7
$ mailmerge
>>> message 0
TO: [email protected]
SUBJECT: Testing mailmerge UTF8 support
FROM: [email protected]
Content-Type: text/plain; charset="UTF-8"

Hi, Séan


>>> sent message 0 DRY RUN
>>> Limit was 1 messages.  To remove the limit, use the --no-limit option.
>>> This was a dry run.  To send messages, use the --no-dry-run option.
$ mailmerge --no-dry-run
>>> message 0
TO: [email protected]
SUBJECT: Testing mailmerge UTF8 support
FROM: [email protected]
Content-Type: text/plain; charset="UTF-8"

Hi, Séan


>>> Read SMTP server configuration from mailmerge_server.conf
>>>   host = smtp.gmail.com
>>>   port = 465
>>>   username = [email protected]
>>>   security = SSL/TLS
>>> password for [email protected] on smtp.gmail.com:
Traceback (most recent call last):
  File "/path/to/mailmerge/env/bin/mailmerge", line 9, in <module>
    load_entry_point('mailmerge==1.7.7', 'console_scripts', 'mailmerge')()
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/mailmerge/__main__.py", line 45, in cli
    config_filename=config_filename,
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/mailmerge/api.py", line 232, in main
    sendmail(message, config_filename)
  File "/path/to/mailmerge/env/lib/python3.5/site-packages/mailmerge/api.py", line 94, in sendmail
    message.as_string(),
  File "/usr/lib/python3.5/smtplib.py", line 850, in sendmail
    msg = _fix_eols(msg).encode('ascii')
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 160: ordinal not in range(128)
$ cat mailmerge_template.txt
TO: [email protected]
SUBJECT: Testing mailmerge UTF8 support
FROM: [email protected]
Content-Type: text/plain; charset="UTF-8"

Hi, {{name}}

$ cat mailmerge_database.csv
email,name,number
[email protected],"Séan",17
[email protected],"Bob",42

from mailmerge.

awdeorio avatar awdeorio commented on July 19, 2024

Update: I can reproduce this bug.

from mailmerge.

awdeorio avatar awdeorio commented on July 19, 2024

This is now fixes in version 1.7.8

from mailmerge.

Related Issues (20)

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.