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.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Libre
de virus. www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Fri, Aug 21, 2020 at 2:53 PM Jim S <ato.st...@gmail.com> 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 <ato....@gmail.com> 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 users.
>>>>>> Whenever I test it I get an "Unable to send email" message.
>>>>>>
>>>>>> But I do not really know the reason. I tried with a standalone python
>>>>>> script with the same configuration and it works.
>>>>>>
>>>>>> I'd like to know how to debug this problem or where to look at.
>>>>>>
>>>>>> In which log are email related errors written?
>>>>>> Regards, Jon.
>>>>>>
>>>>>> --
>>>> 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 web...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/web2py/a61e3de4-f288-4968-9001-d21741f881f2o%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/web2py/a61e3de4-f288-4968-9001-d21741f881f2o%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> 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/d6644977-e184-4612-98e6-7556ef88e230o%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/d6644977-e184-4612-98e6-7556ef88e230o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAK8tz32YoN%3DTKo_X%2BaYz7yKoyo9fHCWry8A3dWaG21dx54TK-A%40mail.gmail.com.

Reply via email to