Thanks, I will try working with these. Regards, Jason
On Sun, 2009-06-14 at 06:19 -0700, Fran wrote: > def email_user(sender,message,subject="group notice"): > import smtplib > fromaddr=sender > toaddrs=[x.email for x in db().select(db.recipient.email)] > msg="From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s"%(fromaddr,", > ".join(toaddrs),subject,message) > server = smtplib.SMTP('localhost:25') > server.sendmail(fromaddr, toaddrs, msg) > server.quit() > > def index(): > form=SQLFORM(db.message,fields= > ['your_name','your_email','your_message']) > if form.accepts(request.vars,session): > subject='cfgroup message from '+form.vars.your_name > email_user(sender=form.vars.your_email,\ > message=form.vars.your_message,\ > subject=subject) > response.flash='your message has been submitted' > elif form.errors: > response.flash='please check the form and try again' > return dict(top_message=TOP_MESSAGE,form=form) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@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 -~----------~----~----~----~------~----~------~--~---