T when sending email

40 views
Skip to first unread message

Kenneth

unread,
Apr 16, 2014, 8:20:02 AM4/16/14
to web...@googlegroups.com
Hello,

I'm trying to send email that is made from about 6-7 T('texts'). But newlines are not inserted into the emails.

How should I do that?


Kenneth

Niphlod

unread,
Apr 16, 2014, 4:40:27 PM4/16/14
to web...@googlegroups.com
what format are you sending the emails ? text or html ? What's the used function to send the emails ?

Kenneth

unread,
Apr 16, 2014, 6:06:08 PM4/16/14
to web...@googlegroups.com


Hello,

text

send.mail()


Kenneth

Roberto Perdomo

unread,
Apr 16, 2014, 8:06:02 PM4/16/14
to web...@googlegroups.com
Try something like this if you are using simple text email:

line1 = T('This is line one')
line2 = T('This is line two')
message = '%s\n%s' % (line1, line2)

mail.send(to='y...@example.com',
          subject='hello',
          # If reply_to is omitted, then mail.settings.sender is used
          reply_to='u...@example.com',
          message=message)

Here "\n" do the new line.

In HTML text email, use "<br /> instead of "\n"


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages