Now I understand the problem. Hmmm.. this needs a change in Auth/Mail.
let me think about it.

On 4 Lug, 20:09, Richard <[email protected]> wrote:
> hi Massimo,
>
> sending email directly with the mail API isn't the problem.
> The problem (as explained in the initial post) is for emails sent by
> auth. Auth requires strings for the messages, which means mail will
> always send as plain text.
>
> Perhaps mail should expose a flag for setting the format. Passing a
> tuple to send as HTML feels awkward anyway, and doesn't integrate with
> auth.
>
> Richard
>
> On Jul 5, 6:24 am, mdipierro <[email protected]> wrote:
>
> > The line you changed into is already there. You just have to pass
>
> > mail.sent(....,message=(None,html))
>
> > Did you try it?
>
> > On 4 Lug, 10:38, Richard <[email protected]> wrote:
>
> > > Changed:
> > > attachment.attach(MIMEText.MIMEText(text,_charset='utf-8')) ->
> > > attachment.attach(MIMEText.MIMEText(html, 'html',_charset='utf-8'))
>
> > > so now it always sends as HTML, which is what I want.
>
> > > On Jul 4, 11:55 pm, mdipierro <[email protected]> wrote:
>
> > > > what changes did you make?
>
> > > > On 4 Lug, 07:52, Richard <[email protected]> wrote:
>
> > > > > I needed my auth generated emails to send as HTML format instead of
> > > > > the default text.
>
> > > > > If I understand correctly you have to pass a (text, html) tuple to
> > > > > activate HTML format, but auth requires strings for
> > > > > auth.messages.verify_email, etc.
>
> > > > > To activate HTML format I have temporarily modified the default
> > > > > headers of Mail in gluon/tools.py.
> > > > > Is there a proper way to send HTML emails with auth?
>
> > > > > Richard

Reply via email to