Re: [web2py] Re: How to debug "lost password"

2020-08-29 Thread Dave S


On Monday, August 24, 2020 at 12:32:43 AM UTC-7, Jonsubs wrote:
>
> Hi Jim,
> Actually I thought I did not need to "send" the mail myself. I thought the 
> framework took care of it.
>
> But I think I'll try to send the email in some part of the application to 
> test if everything is ok. Thanks for the suggestion Jim. I'll try it and 
> get back to you.
> Thanks, Jon.
>
>
The framework needs to be told what to send, and that's what mail.send() is 
for.
http://web2py.com/books/default/chapter/29/08/emails-and-sms#Sending-emails>

/dps
 

> On Sat, Aug 22, 2020 at 4:51 PM Jim S > 
> wrote:
>
>> Everything there is looking just right.  The only thing you haven't 
>> shared is the mail send line in your web2py app.
>>
>> I haven't used appconfig.ini so can't answer that question.  Have you 
>> tried both ways or tried coding the values directly into your python script?
>>
>> -Jim
>>
>> On Saturday, August 22, 2020 at 3:59:09 AM UTC-5, Jonsubs wrote:
>>>
>>> Hi Jim,
>>> My configuration for appconfig.ini is the following:
>>>
>>> ; smtp address and credentials
>>> [smtp]
>>> server = mail.xakemate.eus:25
>>> sender = ad...@xakemate.eus
>>> login  = ad...@xakemate.eus:***
>>> tls= false
>>> ssl= false
>>>
>>> When I try the following script (from my laptop) it does work.
>>>
>>> import smtplib
>>> import email.utils
>>> from email.mime.text import MIMEText
>>>
>>> def send(receiver):
>>> # Create the message
>>> msg = MIMEText('This is the body of the message.')
>>> msg['To'] = email.utils.formataddr(('Recipient', receiver))
>>> msg['From'] = email.utils.formataddr(('Author', 
>>> 'ad...@xakemate.eus'))
>>> msg['Subject'] = 'Simple test message'
>>>
>>>
>>> server = smtplib.SMTP('mail.xakemate.eus',25)
>>> server.ehlo() # Can be omitted
>>> server.login('ad...@xakemate.eus', '')
>>> server.set_debuglevel(True) # show communication with the server
>>> try:
>>> server.sendmail('ad...@xakemate.eus',
>>> [receiver],
>>> msg.as_string())
>>> finally:
>>> server.quit()
>>>
>>>
>>>
>>> if __name__=="__main__":
>>> send('ad...@xakemate.eus')
>>> 
>>> Byt the way, should values in "appconfig.ini" be quoted? Meaning, should 
>>> I use 'mail.xakemate.eus:25' or mail.xakemate.eus:25 (with no quotes)?
>>> Thanks, Jon.
>>>
>>>
>>> 
>>>  Libre 
>>> de virus. www.avast.com 
>>> 
>>>  
>>> <#CAK8tz30zdXiHUvPxiLO+Um+oYfeOvPqF_Ve--AEJt6bpgt1hVw@mail.gmail.com_m_-2349229599040815489_CAK8tz32YoN=TKo_X+aYz7yKoyo9fHCWry8A3dWaG21dx54TK-A@mail.gmail.com_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
>>>
>>> On Fri, Aug 21, 2020 at 2:53 PM Jim S  wrote:
>>>
 Hey Jon, I should have been more specific.  What I was looking for was 
 the actual server and port you're accessing for the mail server.  Looks 
 like it is stored in your config.  Is that mail server accessible from you 
 workstation?  Can you telnet to it using the settings in the config file?

 -Jim

 On Friday, August 21, 2020 at 4:51:55 AM UTC-5, Jonsubs wrote:
>
> Hi everyone,
> Whe I run my web2py app locally (in my desktop in 127.0.0.1:8000) I 
> get the following message:
>
> '08/21/2020 11:48:56 AM' - web2py - WARNING - Mail.send failure:please 
> run connect() first
>
> What does it mean?
> Thanks, Jon.
>
> On Fri, Aug 21, 2020 at 11:45 AM Jon Subscripted <
> jonsubsc...@gmail.com> wrote:
>
>> Hi Jim,
>> It looks like this (see below):
>>
>> # 
>> -
>> # configure email
>> # 
>> -
>> mail = auth.settings.mailer
>> mail.settings.server = configuration.get('smtp.server') #'logging' if 
>> request.is_local else configuration.get('smtp.server')
>> mail.settings.sender = configuration.get('smtp.sender')
>> mail.settings.login = configuration.get('smtp.login')
>> mail.settings.tls = configuration.get('smtp.tls') or False
>> mail.settings.ssl = configuration.get('smtp.ssl') or False
>>
>> Thanks, Jon.
>>
>> On Fri, Aug 21, 2020 at 1:56 AM Jim S  wrote:
>>
>>> What does your mail setup in db.py look like?
>>>
>>> -Jim
>>>
>>>
>>> On Thursday, August 20, 2020 at 9:47:11 AM UTC-5, Jonsubs wrote:

 Any suggestions on how to debug "password lost" email not being 
 sent.
 Thanks, Jon.

 On Wed, Aug 19, 2020 at 7:49 PM Jon Subscripted <
 jonsubsc...@gmail.com> wrote:

> Hi everyone,
> I'm having some trouble sending "lost password" emails to my 
> 

[web2py] Re: About putting values into database

2020-08-29 Thread Dave S


On Friday, August 21, 2020 at 7:33:54 AM UTC-7, Andrea Fae' wrote:
 

> [...]
> What is wrong? How to correct?
> Thank  you
>

 I don't know.  I don't use crud(), which seems to never have been more 
than experimental and has been deprecated for several years.  I use FORM() 
and SQLFORM().  I'm not sure there are many here with crud() experience, so 
I'm not sure who to tell you to turn to.

I take it the line illustrating the wrong results is from appadmin.  Can 
you fill out a new entry using appadmin's "New" button?  Does that get the 
created_on and created_by fields correct?  When you display your form, does 
it show the correct defaults in each field?

/dps

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/fc8df391-5203-4296-9447-34e28f121bfao%40googlegroups.com.