当前位置: 首页>>代码示例>>Python>>正文


Python SMTP.__init__方法代码示例

本文整理汇总了Python中smtplib.SMTP.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SMTP.__init__方法的具体用法?Python SMTP.__init__怎么用?Python SMTP.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在smtplib.SMTP的用法示例。


在下文中一共展示了SMTP.__init__方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
	def __init__(self, host='', port=0, local_hostname=None, config=VDOM_config()):
		self.tout = config.get_opt("SMTP-SENDMAIL-TIMEOUT")
		if None == self.tout: self.tout = 30.0
		self.tout = float(self.tout)
		self.use_ssl = config.get_opt("SMTP-OVER-SSL")
		if None == self.use_ssl: self.use_ssl = 0
		SMTP.__init__(self, host = '', port = 0, local_hostname = None)
开发者ID:VDOMBoxGroup,项目名称:runtime2.0,代码行数:9,代码来源:email1.py

示例2: spam

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
 def spam(self):
     SMTP.__init__(self, self.host, self.port)
     self.ehlo()
     self.starttls()
     self.ehlo()
     self.login(self.user, self.password)
     self.sendmail(self.user, self.receiver, self.msg.as_string())
     self.quit()
开发者ID:cacounicamp,项目名称:CACo-spammer,代码行数:10,代码来源:spammer.py

示例3: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
    def __init__(self, account, password):
        '''Initialize a new instance with Google account and password'''

        self.account = account

        SMTP.__init__(self, 'smtp.gmail.com', 587)
        self.ehlo()
        self.starttls()
        self.ehlo()
        self.login(self.account, password)
开发者ID:snow,项目名称:pyrcp,代码行数:12,代码来源:gsmtplib.py

示例4: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
 def __init__(self, parent, **kwargs):
     self.parent = parent
     self.make_response = parent.make_response
     self._last_smtp_response = (None, None)
     self.tls = kwargs.pop('tls', False)
     self.debug = kwargs.pop('debug', False)
     self.user = kwargs.pop('user', None)
     self.password = kwargs.pop('password', None)
     SMTP.__init__(self, **kwargs)
     self.initialize()
开发者ID:lisbitid,项目名称:less_flask,代码行数:12,代码来源:client.py

示例5: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
    def __init__(self, tunnelhost, host='', port=0, local_hostname=None):
        """Initialize a new instance.

        tunnelhost:
            The server to SSH through. SSH must be configured for passwordless
            login to this server.
        host:
            The remote mailserver.
        port:
            The port on the mailserver, default: smtplib.SMTP_PORT.
        local_hostname:
            The FQDN of the local host, default: socket.getfqdn().

        An SMTPConnectError is raised if the specified mail host doesn't
        respond correctly.

        """
        self.tunnelhost = tunnelhost
        SMTP.__init__(self, host=host, port=port,
                              local_hostname=local_hostname)
开发者ID:datagrok,项目名称:python-misc,代码行数:22,代码来源:email.py

示例6: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
 def __init__(self,server='localhost',
              from_name=Osiride().get_username(),
              from_mail=Osiride().get_usermail()):
     SMTP.__init__(self,server)
     self.from_name = from_name
     self.from_mail = from_mail
开发者ID:exedre,项目名称:e4t.new,代码行数:8,代码来源:mail.py

示例7: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
 def __init__(self, server, serverUser=None, serverPassword=None, port=25):
     "Connect to the given SMTP server."
     SMTP.__init__(self, server, port)
     self.user = serverUser
     self.password = serverPassword
开发者ID:noelmcloughlin,项目名称:wrox-python,代码行数:7,代码来源:SendMail.py

示例8: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
 def __init__(self, server, serverUser=None, serverPassword=None, port=25):
     SMTP.__init__(self, server, port)
     self.user = serverUser
     self.password = serverPassword
开发者ID:mdmahedihasan,项目名称:beginning_python_by_james_payne,代码行数:6,代码来源:SendMail.py

示例9: __init__

# 需要导入模块: from smtplib import SMTP [as 别名]
# 或者: from smtplib.SMTP import __init__ [as 别名]
 def __init__(self,host='',port=0,local_hostname=None):
     SMTP.__init__(self, host, port, local_hostname)
     # Use a dummy function for the progress bar
     self.progressBar=lambda total,sent,speed,elapsed:None
     self.ui=None
开发者ID:fivesheep,项目名称:sendemail,代码行数:7,代码来源:gsend.py


注:本文中的smtplib.SMTP.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。