當前位置: 首頁>>代碼示例>>Python>>正文


Python Mail.send方法代碼示例

本文整理匯總了Python中gluon.tools.Mail.send方法的典型用法代碼示例。如果您正苦於以下問題:Python Mail.send方法的具體用法?Python Mail.send怎麽用?Python Mail.send使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gluon.tools.Mail的用法示例。


在下文中一共展示了Mail.send方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: approve_tender

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def approve_tender():
    tid=request.args(0)
    sid=request.args(1)
    db(db.bidding.item_id==sid).update(Status='Rejected')
    db(db.bidding.id ==tid).update(Status='Approved')
    db(db.item_info.id ==sid).update(Status='Work In Progress')
    tend_list= db(db.bidding.id==tid).select(db.bidding.ALL)
    for e in tend_list:
        val=e.UserID
        pass
    user_list=db(db.auth_user.id==val).select(db.auth_user.ALL)
    for e in user_list:
        val=e.email
        pass
    print val
    mail = Mail()
    mail.settings.server = 'smtp.gmail.com:587'
    mail.settings.sender = '[email protected]'
    mail.settings.tls = True
    mail.settings.login = '[email protected]:tushujain'
    msg='Congratulations!!! your Tender ID ' +tid +' has been approved. Contact respective office for further details'
    mail.send(val,'Approval of tender',msg)

    session.b=tid
    redirect(URL('adminshow_tender'))
    return dict(mid=mid)
開發者ID:imsiddhartha,項目名稱:iiitbid,代碼行數:28,代碼來源:default.py

示例2: tux

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def tux():
	response.title = 'Avatares do Tux'
	import os
	import random
	from gluon.tools import Recaptcha
	response.meta.keywords = 'tux, mascote, pinguim, penguin, avatar, linux, debian, ubuntu'
	list_tux = os.listdir('/home/www-data/web2py/applications/init/static/images/tux_avatar')
	tux_imgs = []
	for item in range(12):
		tux_imgs.append(random.choice(list_tux))
	use_recaptch = True
	form = SQLFORM(db.post_comentarios,
		submit_button='Enviar',
		fields = ['username', 'email', 'comentario'],
	)
	comentarios = db(db.post_comentarios).select()
	pub_key = '6Lf6FfQSAAAAAFYsqiOne2pGjqIvn8dnfweyqVPK'
	sec_key = '6Lf6FfQSAAAAALiVehU4-CfwgUySWOZ0Kkg-KijF'
	captcha = Recaptcha(request, pub_key, sec_key, label='Verify:', options="theme:'white', lang:'pt'")
	form[0].append(TR('',captcha,''))
	if form.process().accepted:
		from gluon.tools import Mail
		mail = Mail('smtp.gmail.com:587','[email protected]','knzchi:ax0rgmail')
		mail.send(['[email protected]','[email protected]'],
			'Comentario recebido | {}'.format(request.function),
			'\r\n'.join([response.session_client,request.vars.username,request.vars.email,request.vars.comentario])
		)
		redirect(URL("{}#comentarios".format(request.function)))
		redirect(URL(request.function))
	elif form.errors:
		response.flash = 'form has errors'
	return dict(comentarios=comentarios,form=form,tux_imgs = tux_imgs)
開發者ID:SilvioGiunge,項目名稱:alvolivre,代碼行數:34,代碼來源:default.py

示例3: pegar_ip_valido

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def pegar_ip_valido():
	response.title = 'Descobrir o ip valido em um terminal unix usando python'
	response.meta.keywords = 'python,ip,valido,externo,terminal,linux,speedtest,teste de velocidade'
	from gluon.tools import Recaptcha
	form = SQLFORM(db.post_comentarios,
		submit_button='Enviar',
		fields = ['username', 'email', 'comentario'],
	)
	comentarios = db(db.post_comentarios).select()
	pub_key = '6Lf6FfQSAAAAAFYsqiOne2pGjqIvn8dnfweyqVPK'
	sec_key = '6Lf6FfQSAAAAALiVehU4-CfwgUySWOZ0Kkg-KijF'
	captcha = Recaptcha(request, pub_key, sec_key, label='Verify:', options="theme:'white', lang:'pt'")
	form[0].append(TR('',captcha,''))
	if form.process().accepted:
		from gluon.tools import Mail
		mail = Mail('smtp.gmail.com:587','[email protected]','knzchi:ax0rgmail')
		mail.send(['[email protected]','[email protected]'],
			'Comentario recebido | {}'.format(request.function),
			'\r\n'.join([response.session_client,request.vars.username,request.vars.email,request.vars.comentario])
		)
		redirect(URL("{}#comentarios".format(request.function)))
		redirect(URL(request.function))
	elif form.errors:
		response.flash = 'form has errors'
	return dict(form=form,comentarios=comentarios)
開發者ID:SilvioGiunge,項目名稱:alvolivre,代碼行數:27,代碼來源:default.py

示例4: aumentar_resolucao_backtrack_virtualbox

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def aumentar_resolucao_backtrack_virtualbox():
	response.title = 'Aumentar a resolução do Back Track 5 no Virtual Box'
	response.meta.keywords = 'resolução,tela,screen,backtrack,virtualbox,linux'
	from gluon.tools import Recaptcha
	use_recaptch = True
	form = SQLFORM(db.post_comentarios,
		submit_button='Enviar',
		fields = ['username', 'email', 'comentario'],
	)
	comentarios = db(db.post_comentarios).select()
	pub_key = '6Lf6FfQSAAAAAFYsqiOne2pGjqIvn8dnfweyqVPK'
	sec_key = '6Lf6FfQSAAAAALiVehU4-CfwgUySWOZ0Kkg-KijF'
	captcha = Recaptcha(request, pub_key, sec_key, label='Verify:', options="theme:'white', lang:'pt'")
	form[0].append(TR('',captcha,''))
	if form.process().accepted:
		from gluon.tools import Mail
		mail = Mail('smtp.gmail.com:587','[email protected]','knzchi:ax0rgmail')
		mail.send(['[email protected]','[email protected]'],
			'Comentario recebido | {}'.format(request.function),
			'\r\n'.join([response.session_client,request.vars.username,request.vars.email,request.vars.comentario])
		)
		redirect(URL("{}#comentarios".format(request.function)))
		redirect(URL(request.function))
	elif form.errors:
		response.flash = 'form has errors'
	return dict(form=form,comentarios=comentarios)
開發者ID:SilvioGiunge,項目名稱:alvolivre,代碼行數:28,代碼來源:default.py

示例5: fazendo_backup_com_google_drive

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def fazendo_backup_com_google_drive():
	response.title = 'Como usar o google drive como ferramenta de backup'
	response.meta.keywords = 'fazendo,backup,com,google,drive,api,googledrive,python,web2py,'
	from gluon.tools import Recaptcha
	form = SQLFORM(db.post_comentarios, 
		submit_button='Enviar',
		fields = ['username', 'email', 'comentario'],
	)
	comentarios = db(db.post_comentarios).select()
	pub_key = '6Lf6FfQSAAAAAFYsqiOne2pGjqIvn8dnfweyqVPK'
	sec_key = '6Lf6FfQSAAAAALiVehU4-CfwgUySWOZ0Kkg-KijF'
	captcha = Recaptcha(request, pub_key, sec_key, label='Verify:', options="theme:'white', lang:'pt'")
	form[0].append(TR('',captcha,''))
	if form.process().accepted:
		from gluon.tools import Mail
		mail = Mail('smtp.gmail.com:587','[email protected]','knzchi:ax0rgmail')
		mail.send(['[email protected]','[email protected]'],
			'Comentario recebido | {}'.format(request.function),
			'\r\n'.join([response.session_client,request.vars.username,request.vars.email,request.vars.comentario])
		)
		redirect(URL("{}#comentarios".format(request.function)))
		redirect(URL(request.function))
		redirect(URL("{}#comentarios".format(request.function)))
		response.flash = 'form has errors'
	elif form.errors:
		response.flash = 'form has errors'
	return dict(form=form,comentarios=comentarios)
開發者ID:SilvioGiunge,項目名稱:alvolivre,代碼行數:29,代碼來源:default.py

示例6: threads_em_python

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def threads_em_python():
	response.title = 'Threads em python'
	response.meta.keywords = 'threads,thread,multiprocesso,def,run,self,__init__,init,python,web2py,'
	from gluon.tools import Recaptcha
	form = SQLFORM(db.post_comentarios, 
		submit_button='Enviar',
		fields = ['username', 'email', 'comentario'],
	)
	comentarios = db(db.post_comentarios).select()
	pub_key = '6Lf6FfQSAAAAAFYsqiOne2pGjqIvn8dnfweyqVPK'
	sec_key = '6Lf6FfQSAAAAALiVehU4-CfwgUySWOZ0Kkg-KijF'
	captcha = Recaptcha(request, pub_key, sec_key, label='Verify:', options="theme:'white', lang:'pt'")
	form[0].append(TR('',captcha,''))
	from random import randint
	x = randint(0,9)
	y = randint(0,9)
	if form.process().accepted:
		from gluon.tools import Mail
		mail = Mail('smtp.gmail.com:587','[email protected]','knzchi:ax0rgmail')
		mail.send(['[email protected]','[email protected]'],
			'Comentario recebido | {}'.format(request.function),
			'\r\n'.join([response.session_client,request.vars.username,request.vars.email,request.vars.comentario])
		)
		redirect(URL("{}#comentarios".format(request.function)))
		redirect(URL(request.function))
		response.flash = 'form has errors'
	elif form.errors:
		response.flash = 'form has errors'
	return dict(form=form,comentarios=comentarios)
開發者ID:SilvioGiunge,項目名稱:alvolivre,代碼行數:31,代碼來源:default.py

示例7: cronJob

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def cronJob():
    print 'cron job executed'

    mail = Mail()
    mail.settings.server = 'smtp.gmail.com:587'
    mail.settings.sender = '[email protected]'
    mail.settings.login = '[email protected]:t56A2BA08K'

    print 'mail server OK'

    for row in db(db.subscription.id > 0).select():
        print row.email, row.link, row.price
        scraper = Scraper(row.link)
        cprice = scraper.scrap()
        print cprice
        if cprice < row.price:
            print 'preparing email'
            mail.send(row.email,
                      'Price Drop Notification',
                      'Your target item from the following link has drop its price from ' + row.price + ' to ' + cprice + '.\n'
                      + row.link)
            print 'mail sent'
            db(db.subscription.link == row.link).update(price = cprice)
            print 'price reset'

    db.commit()
開發者ID:q23qweliuhan,項目名稱:Price-Drop-Master,代碼行數:28,代碼來源:cronJob.py

示例8: como_instalar_o_firefox_no_debian

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def como_instalar_o_firefox_no_debian():
	response.title = 'Como instalar o Firefox no Debian 7'
	response.meta.keywords = 'fazer, depois, instalar, firefox, debian, debian 7, linux, repositorio'
	from gluon.tools import Recaptcha
	use_recaptch = True
	form = SQLFORM(db.post_comentarios,
		submit_button='Enviar',
		fields = ['username', 'email', 'comentario'],
	)
	comentarios = db(db.post_comentarios).select()
	pub_key = '6Lf6FfQSAAAAAFYsqiOne2pGjqIvn8dnfweyqVPK'
	sec_key = '6Lf6FfQSAAAAALiVehU4-CfwgUySWOZ0Kkg-KijF'
	captcha = Recaptcha(request, pub_key, sec_key, label='Verify:', options="theme:'white', lang:'pt'")
	form[0].append(TR('',captcha,''))
	if form.process().accepted:
		from gluon.tools import Mail
		mail = Mail('smtp.gmail.com:587','[email protected]','knzchi:ax0rgmail')
		mail.send(['[email protected]','[email protected]'],
			'Comentario recebido | {}'.format(request.function),
			'\r\n'.join([response.session_client,request.vars.username,request.vars.email,request.vars.comentario])
		)
		redirect(URL("{}#comentarios".format(request.function)))
		redirect(URL(request.function))
	elif form.errors:
		response.flash = 'form has errors'
	return dict(form=form,comentarios=comentarios)
開發者ID:SilvioGiunge,項目名稱:alvolivre,代碼行數:28,代碼來源:default.py

示例9: __init__

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
class Send_Mail:

	def __init__(self):
		self.server = Mail('smtp.gmail.com:587', '[email protected]', '[email protected]:[email protected]#')


	def send(self, subject, content, to):
		self.server.send(to, subject, content)
開發者ID:mrugani,項目名稱:bookmark,代碼行數:10,代碼來源:mail.py

示例10: forgot_password

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def forgot_password():
    mail = Mail() 
    mail.settings.server = 'smtp.gmail.com:587' 
    mail.settings.sender = '[email protected]'
    mail.settings.login = '[email protected]:placementpg1' 
    mailid=request.vars.emailid
    row=db(db.company_basicdetails.emailid==mailid).select().first()
    if row:
        msg=row.pwd
        mail.send(to=[str(mailid)], subject="Reset Password", message=str(msg))
        return(redirect(URL('default','home')))
開發者ID:ergaurav2,項目名稱:placement-portal,代碼行數:13,代碼來源:company.py

示例11: email

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def email(orglist):
      from gluon.tools import Mail 
      mail = Mail() 
      mail.settings.server = 'smtp.gmail.com:587'
      mail.settings.sender = '[email protected]' 
      mail.settings.login = '[email protected]:iiit123disres' 
      mail.send(to=orglist, 
               subject='Hello World - Test email from web2py', 
               # If reply_to is omitted, then mail.settings.sender is used 
               message='hi there') 
      return
開發者ID:adarshsanjeev,項目名稱:crowdsourcing,代碼行數:13,代碼來源:default.py

示例12: close_bidding

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def close_bidding():
    sid=request.args(0)
    ele_list=db(db.bidding.item_id==sid).select(db.bidding.ALL)
    max=0
    uid1=0
    iname=""
    for ed1 in ele_list:
        if ed1.bid_amt>max:
            max=ed1.bid_amt
            uid1=ed1.UserID
            iid=ed1.item_id
    mail1=""
    #iname=db(db.item_info.id ==iid).select(db.item_info.Name)
    #mail1=db(db.auth_user.id ==uid1).select(db.auth_user.email)
    db(db.item_info.id ==sid).update(sold_amt=max)
    db(db.item_info.id ==sid).update(buyers_id=uid1)
    db(db.item_info.id ==sid).update(Status='Bidding Closed')
    item_list=db(db.item_info.id==iid).select(db.item_info.ALL)
    for e in item_list:
        iname=e.Name
        sellid=e.seller_id
        pass
    user_list=db(db.auth_user.id==uid1).select(db.auth_user.ALL)
    for e in user_list:
        mail1=e.email
        pass
    user_list=db(db.auth_user.id==sellid).select(db.auth_user.ALL)
    for e in user_list:
        smail1=e.email
        pass
    #print max
    #print iname
    #print mail1
    #print uid1
    from gluon.tools import Mail
    mail = Mail()

    ## configure email
    mail = auth.settings.mailer
    mail.settings.server = 'smtp.gmail.com:587'
    mail.settings.sender = '[email protected]'
    mail.settings.login = '[email protected]:dkwnbkuobbjatsol'

    ## configure auth policy
    auth.settings.registration_requires_verification = False
    auth.settings.registration_requires_approval = False
    auth.settings.reset_password_requires_verification = True
    string="Congratulations!!!! You Have Bidded for "+iname+" at price "+str(max)+" and It is sold to you.Please Pay and collect the Item"
    mail.send(mail1,'Item Sold To You',string)
    string="Congratulations!!!! Your Item "+iname+" has been sold at price "+str(max)+" to "+mail1
    mail.send(smail1,'Your Item Sold!!!',string)
    redirect(URL('adminshow_closedbids'))
    return dict(mid=mid)
開發者ID:imsiddhartha,項目名稱:iiitbid,代碼行數:55,代碼來源:default.py

示例13: send_an_email

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def send_an_email():

    stylist = db(db.t_stylists.user_id == int(request.vars.user_id)).select().first()
    email = stylist.email

    mail = Mail()
    mail.settings.server = "smtp.gmail.com:587"
    mail.settings.sender = "[email protected]"
    mail.settings.login = "[email protected]:seanashe"

    mail.send(email, "Message from " + str(request.vars.sender_name), str(request.vars.email_stuff))

    return "ok"
開發者ID:ashesean,項目名稱:cmps183_project,代碼行數:15,代碼來源:default.py

示例14: price

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def price():
    if session.price == 'not available':
        response.title = 'Sorry, this webstore is not supported.'
    else:
        response.title = 'Success!'
        mail = Mail()
        mail.settings.server = 'smtp.gmail.com:587'
        mail.settings.sender = '[email protected]'
        mail.settings.login = '[email protected]:t56A2BA08K'
        mail.send(session.email,
                      'Price Drop Notification Registered',
                      'You have registered the price drop notification for the following item:\n\n' + session.link+'\n\n' +
                      'The current price is ' + session.price + '.')
    return dict()
開發者ID:q23qweliuhan,項目名稱:Price-Drop-Master,代碼行數:16,代碼來源:default.py

示例15: sendmail

# 需要導入模塊: from gluon.tools import Mail [as 別名]
# 或者: from gluon.tools.Mail import send [as 別名]
def sendmail():
    mail = Mail() 
    mail.settings.server = 'smtp.gmail.com:587' 
    mail.settings.sender = '[email protected]'
    mail.settings.login = '[email protected]:placementpg1' 
 #elect_id = request.args(0,cast=int) 
 #m=db(db.election.id==elect_id) 
 #for row in db(db.election.id==elect_id).select(): 
 #title=row.title 
 #m.update(electionflag=True) 
 #m.update(row.is_active=False) 
 #for row in db().select(db.voter.ALL): 
 # if row.election_id==title: 
    mail.send(to=['[email protected]'], subject=request.vars.subject, message=request.vars.msg)
    return(redirect(URL('student','home')))
開發者ID:ergaurav2,項目名稱:placement-portal,代碼行數:17,代碼來源:student.py


注:本文中的gluon.tools.Mail.send方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。