Hi Annet, long time no see.

>From the gluon/tools.py source under class Mail function send:

to: list or tuple of receiver addresses; will also accept single
object

Hope this helps,
Denes.

On Mar 12, 12:34 pm, annet <annet.verm...@gmail.com> wrote:
> I am trying to work out a working version of this: Using the Template
> System to Generate Emails,  page 146 -147 of the web2py.
>
> 1. The database table in db.py:
> db.define_table('nfa',
>
> Field('bedrijf',db.bedrijf,default='',notnull=True,ondelete='CASCADE',writable=False,readable=False),
>
> Field('nfatype',db.nfatype,default='',notnull=True,ondelete='RESTRICT'),
>     Field('adres',length=72,default='',notnull=True),
>     migrate=False)
>
> 2. The mail settings in db.py:
> from gluon.tools import *
> mail=Mail()
> mail.settings.server='smtp.web...ion.com:587'
> mail.settings.sender='adm...ise.eu'
> mail.settings.login='xxxxxx'
>
> Where I would like to send every comapny in a message , stored in a
> view file "html_mail.html":
>
> 3. The function in default.py
> def send_mail():
>
> nfas=db(db.nfa.nfatype==3).select(db.nfa.ALL,orderby=db.nfa.bedrijf)
>     for nfa in nfas:
>         context = dict(nfa=nfa)
>         message = response.render('html_mail.html', context)
>         mail.send(to=['.....'], subject='None', message=message)
>     .....
>
> My questions are: what goes here: to= ['....'] the mail address to
> which I would like to send the mail is in nfas.adres and how does this
> function end, I mean what goes at the ...
>
> Kind regards,
>
> Annet.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to