'ascii' codec can't encode characters

Asked by bousselmi

Hi,

I tried to send mails with text in French ie with accented characters, but I still have the following message:''.

I tried to enter changes to the code based on the responses of ticket # 4532020 but I'm still the same problem encoding.

Thank you answer me as soon as possible
Best regards

Question information

Language:
English Edit question
Status:
Answered
For:
Power Email Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#1

Can you paste the template here?

Revision history for this message
bousselmi (as-bousselmi) said :
#2

Hi,

I write a text in French with accents such as "télécharger un fichier" and try to send it, but in the history tab of the advanced form receives a mail, the following message appears " 'ascii' codec can not encode character is position ...".
Even if I use a template containing a text in French and I try to send mail from, for example, sales management module, the message is not sent and when I try to send again from the mail interface, the same message encoding appears.

it is an encoding problem, Please help me fix this problem
Thank you

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#3

Are you using the trunk version?

Revision history for this message
bousselmi (as-bousselmi) said :
#4

yes I use the trunk version.
when I update poweremail I use this URL: http://bazaar.launchpad.net/~openerp-commiter/poweremail/poweremailtrunk/

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#5

Hi can you paste your exact template here?

Revision history for this message
bousselmi (as-bousselmi) said :
#6

Name of template: template001
Model: sale order
Mail details:
    recepient: <email address hidden>
    default subject: sale
    Standard body:
         body (text): j'ai rencontré un problème lors de l'envoi des mails avec des textes en français
Advanced:
     Anforce from account: MyAccount

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#7

This is identified as a bug and i have fixed it such that a clarity exists if anybody using a previous version faces it.

Please update your module from trunk and check

Revision history for this message
bousselmi (as-bousselmi) said :
#8

After updating the module poweremail (143 bazaar version), I tried to send emails, but another error occurs: "local variable 'body_html' referenced before assignment"

you're wrong, you used two variables instead of one in the function send_mail of poweremail_core, you used the variable body_html and the variable html_body, so we must replace all occurrences of html_body by body_html and the problem will be solved.

Thanks

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#9

Fixed,
Can you check again?

Revision history for this message
bousselmi (as-bousselmi) said :
#10

It's OK, I have any error when I send mails with french text.
mail sent successfully

Revision history for this message
bousselmi (as-bousselmi) said :
#11

hi,

using the latest version of poweremail (revision 144 of trunk), the problem of encoding accented characters no longer occurs, but can not send and receive mail.
In fact,I create an email, I trie to send it, the message that appears in the History is "Email sent successfully" but the mail does not appear in the inbox of the recipient.
The mail never reaches the recipient.

I tried to look the problem in the code, but I failed to find a solution for that.
Thank you for solving this problem of sending mail.
Best regards

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#12

Not sure I can replicate this problem because mails are getting sent on my side.

Two debug checks:

1. Are there accented characters in to address?
2. Check the smtp server

Revision history for this message
bousselmi (as-bousselmi) said :
#13

hi,

the account that I use is:
   * outgoing
          server: smtp.gmail.com
          port: 25
          use ssl: unchecked
          Email ID: <email address hidden>
          Password: mypassword
          user name: <email address hidden>
          related user: administrator
          Mail format: Both HTML & Text
          Company mail A/C: yes

   * Incoming
         Incoming server: imap.gmail.com
         server type: imap
         port : 993
         use ssl: checked
         Folder: INBOX
         user name: <email address hidden>
         password : mypassword

    * Security:
         Allowed user groups: I add all group name that I have

the email addresses thet I use are yahoo and gmail addresses

thanks

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#14

I am not sure if gmail works on port 25 and without SSL

Revision history for this message
bousselmi (as-bousselmi) said :
#15

with the port 587 and with SSL the outgoing connection is failed.
with the port 25 and with SSL the outgoing connection is failed
Only with the port 25 and without SSL the outgoing connection is successful.

I tried creating the account with Windows XP.

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#16

Try with port 465 instead of 587 with ssl enabled.

Details here: http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

Revision history for this message
bousselmi (as-bousselmi) said :
#17

Hi,

I used port 465 for smtp.gmail.com server with SSL, but I still have the same connection problem.
Even with the port 25 without SSL, the connection is always failed.

I tried using another gmail address that I just created but I failed to connect to the SMTP server.

NB: I put to you that I use GTK Client and not the client's web openerp but I think that the connection problem is not related to openerp client used

Thanks

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#18

The only remaining answer is check your firewall.

Being windows, check your antivirus systems and the funny windows firewall.

Revision history for this message
bousselmi (as-bousselmi) said :
#19

I use Outlook account witn the port 25 for smtp without SSL and the port 110 for IMPA without SSL, and it's OK
I can Send and receive mails with french text

but my problem now is that when I send an email to a gmail or yahoo address, the text of mail arrives duplicated.

exemple:

Asma,

Lors de la migration, tu as écrasé les fenêtres de suivi des cas ce qui fait que je ne vois plus la colonne Résolution ! Peux-tu la remettre stp ?

Merci
Alban Clot

Aaa,

Lors de la migration, tu as écrasé les fenêtres de suivi des cas ce qui fait que je ne vois plus la colonne Résolution ! Peux-tu la remettre stp ?

Merci
Aaa,

Lors de la migration, tu as écrasé les fenêtres de suivi des cas ce qui fait que je ne vois plus la colonne Résolution ! Peux-tu la remettre stp ?

Merci

thanks

Revision history for this message
bousselmi (as-bousselmi) said :
#20

I use Outlook account witn the port 25 for smtp without SSL and the port 110 for IMPA without SSL, and it's OK
I can Send and receive mails with french text

but my problem now is that when I send an email to a gmail or yahoo address, the text of mail arrives duplicated.

exemple:
Aaa,

Lors de la migration, tu as écrasé les fenêtres de suivi des cas ce qui fait que je ne vois plus la colonne Résolution ! Peux-tu la remettre stp ?

Merci
Aaa,

Lors de la migration, tu as écrasé les fenêtres de suivi des cas ce qui fait que je ne vois plus la colonne Résolution ! Peux-tu la remettre stp ?

Merci

thanks

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#21

Can you tell me the format of the mail you have set in account type?

Is it HTML else Text.

I think your setting is HTML & Text . Is that correct?

Revision history for this message
bousselmi (as-bousselmi) said :
#22

Hi,

Yes, I use the format Both HTML & Text

Revision history for this message
bousselmi (as-bousselmi) said :
#23

what's problèm in using the format Both HTML & Text
And what's the format used in our case

thx

Revision history for this message
Sharoon Thomas http://openlabs.co.in (sharoonthomas) said :
#24

I'd recommend to use HTMl otherwise text.

Can you help with this problem?

Provide an answer of your own, or ask bousselmi for more information if necessary.

To post a message you must log in.