Hi I test your suggestion. and mail.error shows __init__() got an unexpected keyword argument 'source_address'
here is the code smtp_args = self.settings.server.split(':') kwargs = dict(timeout=self.settings.timeout) if self.settings.ssl: server = smtplib.SMTP_SSL(*smtp_args, **kwargs) else: # server = smtplib.SMTP(*smtp_args, **kwargs) server = smtplib.SMTP(*smtp_args, source_address=('MY_IP_ADDRESS', 0)) Leonel Câmara於 2016年3月23日星期三 UTC+8下午6時01分10秒寫道: > > I think web2py is sending its mail using IPv6 because the default OS > behavior for the environment you're using web2py on is to have your IPv6 > address as the source_address. > > Can you do a test for me? In gluon/tools.py can you change: > > server = smtplib.SMTP(*smtp_args, **kwargs) > > To: > > server = smtplib.SMTP(*smtp_args, source_address=(YOUR_IPV4_ADDRESS, 0)) > > Restart web2py and tell me if this works. If it does I will make a pull > request so you can have a mail.setttings.source_address and fix this issue > in case something is misconfigured in your web2py environment and it's > using IPv6 against your will. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.