Howto obtain some result from email.send

26 views
Skip to first unread message

Алексей Романов

unread,
Jun 3, 2014, 6:56:01 AM6/3/14
to websc...@googlegroups.com
Hello!

I've tried multiple times sending emails from my webscript using email.send, but I can't obtain any letters. 
I used 2 options -  gmail SMTP and hetzner SMTP. HTTP status code of my webscript was 200. 

I've tried to analyze return value of email.send, but it always return some empty value:
res = email.send { ... }

I understand, that I can make mistakes, but I should have opportunity to fix them using some error codes/error messages from email.send

Is there any way to know result of execution of email.send?

E.g. when somebody uses Python smtp, this module usually throws meaningful exception, when something goes wrong. 

Problem code example:

local username = 'x...@bla-bla-bla.org'
local password = 'secure pass'
local server = 'mail.your-server.de'

 
email.send {
server=server, username=username, password=password,
from=username, 
to='<yo-ho-ho>@gmail.com',
subject='EPIC FAIL with localhost',
        text='DEAD, AAAA!'
}

Steve Marx

unread,
Jun 3, 2014, 11:49:30 AM6/3/14
to Алексей Романов, websc...@googlegroups.com
There's no return value from email.send(), but an exception should be raised if there's an SMTP error. (Under the covers, we use Python's smtplib to send email, and we bubble up SMTPDataErrors.) If there's an unhandled exception, you should see it in your script's log.

Are you 100% sure that this code is actually getting executed and that the recipient email is correct? Have you checked the spam folder in the recipient's email? Have you tried sending email using the same server/username/password via something else (like Python's smtplib, if you're familiar with that)?



--
You received this message because you are subscribed to the Google Groups "Webscript.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webscriptio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Алексей Романов

unread,
Jun 11, 2014, 11:13:11 AM6/11/14
to websc...@googlegroups.com, dredn...@gmail.com
Thank you! 

In my case spam-filter was guilty, I always forget about it:). 
Reply all
Reply to author
Forward
0 new messages