def get(self): date = datetime.datetime.today() + datetime.timedelta(hours=9) if date.day == 1: password = getRandomString(12) #mail = SendMail(password) mail = SendMail(password) mail.send()
def send_reminder_email(): users = CAUser.all().fetch(10000) for user in users: if user.type == 0: email = user.google_user.email() elif user.type == 2: email = user.native_user.email mail = EmailMessage(sender="*****@*****.**", to=email, subject="Recordatorio de Quinielaca.com", html="<html><body><img src=\"http://img84.imageshack.us/img84/210/emailxy.png\"/></body></html>") mail.send()
def sendMail (ctx): # logging.info (ctx) kw = {} kw['sender'] = '*****@*****.**' kw['to'] = '*****@*****.**' kw['subject'] = 'daily rss feeds' kw['body'] = ' ' kw['html'] = ctx mail = EmailMessage (**kw); mail.send (); """
def post(self): session = get_current_session() username = self.request.get('username').lower() email = self.request.get('email') passwd = self.request.get('password') if len (username.strip()) < 3 or len (username.strip()) > 12: return self._send_error('The username must be between 3 and 12 chars') if not email_re.match(email): return self._send_error('Sorry, is not a valid email address') if len (passwd.strip()) < 6: return self._send_error('The password must be at least 6 chars') if User.is_nickname_exists( username ): return self._send_error('Sorry, that user is already taken') if User.is_email_exists(email): return self._send_error('Sorry, this email is already in use') user = User( nickname=username, email=email, password= User.slow_hash(passwd) ); user.put() if session.is_active(): session.terminate() session.regenerate_id() session['user'] = user body = 'Hello %s,<br/>Your account has been created and is ready to use.<br/><br/>Your login details are:<br/><br/>Username <strong>%s</strong><br/>Password <strong>%s</strong><br/><br/>Thanks and bon appetit!' % ( username, username, passwd ) mail = Mailing.Notification() mail.send(email, 'Welcome to Kochster', body) self.response.out.write( simplejson.dumps({'status':'success', 'message':'Success'}) )