[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Niphlod
BTW: all of these are showing that all of them return *False*! 
...what python version are you using ? The first log shows that no SSL 
is available.
Please print both server.result and server.error 

-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Aurelijus Useckas
Gmail server gives an error of:
*No SSL support included in this Python*

I'm using 2.6v of Python, doesn't it support it?

ordinary server gives an error of:
*STARTTLS extension not supported by server.*

Would it be possible to somehow bypass the STARTTLS initialization? I'm 
good with simple smtp. 

btw server.result = {}

thnx 

On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*! 
 ...what python version are you using ? The first log shows that no SSL 
 is available.
 Please print both server.result and server.error 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Niphlod

On Tuesday, December 4, 2012 12:25:00 PM UTC+1, Aurelijus Useckas wrote:

 Gmail server gives an error of:
 *No SSL support included in this Python*

 I'm using 2.6v of Python, doesn't it support it?


It should, in theory, if openssl headers are compiled into the distribution 
you have. That's all a different problem
 


 ordinary server gives an error of:
 *STARTTLS extension not supported by server.*

 Would it be possible to somehow bypass the STARTTLS initialization? I'm 
 good with simple smtp. 

  
tls=False on the server istantiation or settings.tls = False in db.py . 
By default it's true for security measures.

 

 btw server.result = {}

 thnx 

 On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*! 
 ...what python version are you using ? The first log shows that no 
 SSL is available.
 Please print both server.result and server.error 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Aurelijus Useckas
Yes, I've turned the TLS off and now it works :)

thanks for your very valuable tips!  

On Tuesday, December 4, 2012 1:45:41 PM UTC+2, Niphlod wrote:


 On Tuesday, December 4, 2012 12:25:00 PM UTC+1, Aurelijus Useckas wrote:

 Gmail server gives an error of:
 *No SSL support included in this Python*

 I'm using 2.6v of Python, doesn't it support it?


 It should, in theory, if openssl headers are compiled into the 
 distribution you have. That's all a different problem
  


 ordinary server gives an error of:
 *STARTTLS extension not supported by server.*

 Would it be possible to somehow bypass the STARTTLS initialization? I'm 
 good with simple smtp. 

  
 tls=False on the server istantiation or settings.tls = False in db.py . 
 By default it's true for security measures.

  

 btw server.result = {}

 thnx 

 On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*! 
 ...what python version are you using ? The first log shows that no 
 SSL is available.
 Please print both server.result and server.error 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Aurelijus Useckas
one more question if I may, 

I'm trying to send email to my mailing list (around 1500 emails), bus I get 
a constant error:

WARNING:web2py:Mail.send failure:{'some@email': (451, 'Sender rate 78.5 of 
50 messages per 5m')}


do you know what could be causing this?

On Tuesday, December 4, 2012 1:55:39 PM UTC+2, Aurelijus Useckas wrote:

 Yes, I've turned the TLS off and now it works :)

 thanks for your very valuable tips!  

 On Tuesday, December 4, 2012 1:45:41 PM UTC+2, Niphlod wrote:


 On Tuesday, December 4, 2012 12:25:00 PM UTC+1, Aurelijus Useckas wrote:

 Gmail server gives an error of:
 *No SSL support included in this Python*

 I'm using 2.6v of Python, doesn't it support it?


 It should, in theory, if openssl headers are compiled into the 
 distribution you have. That's all a different problem
  


 ordinary server gives an error of:
 *STARTTLS extension not supported by server.*

 Would it be possible to somehow bypass the STARTTLS initialization? I'm 
 good with simple smtp. 

  
 tls=False on the server istantiation or settings.tls = False in db.py . 
 By default it's true for security measures.

  

 btw server.result = {}

 thnx 

 On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*! 
 ...what python version are you using ? The first log shows that no 
 SSL is available.
 Please print both server.result and server.error 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Niphlod
talking about standards, the 451 error is labelled as  Requested action 
aborted: local error in processing.
that error that returns to you seems to pinpoint that you can only use that 
smtp to send a max of 50 messages in 5 minutes

On Tuesday, December 4, 2012 6:09:23 PM UTC+1, Aurelijus Useckas wrote:

 one more question if I may, 

 I'm trying to send email to my mailing list (around 1500 emails), bus I 
 get a constant error:

 WARNING:web2py:Mail.send failure:{'some@email': (451, 'Sender rate 78.5 
 of 50 messages per 5m')}


 do you know what could be causing this?

 On Tuesday, December 4, 2012 1:55:39 PM UTC+2, Aurelijus Useckas wrote:

 Yes, I've turned the TLS off and now it works :)

 thanks for your very valuable tips!  

 On Tuesday, December 4, 2012 1:45:41 PM UTC+2, Niphlod wrote:


 On Tuesday, December 4, 2012 12:25:00 PM UTC+1, Aurelijus Useckas wrote:

 Gmail server gives an error of:
 *No SSL support included in this Python*

 I'm using 2.6v of Python, doesn't it support it?


 It should, in theory, if openssl headers are compiled into the 
 distribution you have. That's all a different problem
  


 ordinary server gives an error of:
 *STARTTLS extension not supported by server.*

 Would it be possible to somehow bypass the STARTTLS initialization? I'm 
 good with simple smtp. 

  
 tls=False on the server istantiation or settings.tls = False in db.py 
 . By default it's true for security measures.

  

 btw server.result = {}

 thnx 

 On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*! 
 ...what python version are you using ? The first log shows that no 
 SSL is available.
 Please print both server.result and server.error 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread LightDot
The SMTP server you're using has restrains on the number of messages that 
can be sent in a certain time period. Also, make sure the provider's terms 
and conditions allow such usage so that you don't get suspended... In any 
case, these are not really errors and have nothing to do with web2py itself.

Regards,
Ales


On Tuesday, December 4, 2012 6:09:23 PM UTC+1, Aurelijus Useckas wrote:

 one more question if I may, 

 I'm trying to send email to my mailing list (around 1500 emails), bus I 
 get a constant error:

 WARNING:web2py:Mail.send failure:{'some@email': (451, 'Sender rate 78.5 
 of 50 messages per 5m')}


 do you know what could be causing this?

 On Tuesday, December 4, 2012 1:55:39 PM UTC+2, Aurelijus Useckas wrote:

 Yes, I've turned the TLS off and now it works :)

 thanks for your very valuable tips!  

 On Tuesday, December 4, 2012 1:45:41 PM UTC+2, Niphlod wrote:


 On Tuesday, December 4, 2012 12:25:00 PM UTC+1, Aurelijus Useckas wrote:

 Gmail server gives an error of:
 *No SSL support included in this Python*

 I'm using 2.6v of Python, doesn't it support it?


 It should, in theory, if openssl headers are compiled into the 
 distribution you have. That's all a different problem
  


 ordinary server gives an error of:
 *STARTTLS extension not supported by server.*

 Would it be possible to somehow bypass the STARTTLS initialization? I'm 
 good with simple smtp. 

  
 tls=False on the server istantiation or settings.tls = False in db.py 
 . By default it's true for security measures.

  

 btw server.result = {}

 thnx 

 On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*! 
 ...what python version are you using ? The first log shows that no 
 SSL is available.
 Please print both server.result and server.error 



-- 





Re: [web2py] Re: Unable to send emails (mail.send) from server

2012-12-04 Thread Aurelijus
thnx guys


On Tue, Dec 4, 2012 at 10:11 PM, LightDot light...@gmail.com wrote:

 The SMTP server you're using has restrains on the number of messages that
 can be sent in a certain time period. Also, make sure the provider's terms
 and conditions allow such usage so that you don't get suspended... In any
 case, these are not really errors and have nothing to do with web2py itself.

 Regards,
 Ales



 On Tuesday, December 4, 2012 6:09:23 PM UTC+1, Aurelijus Useckas wrote:

 one more question if I may,

 I'm trying to send email to my mailing list (around 1500 emails), bus I
 get a constant error:

 WARNING:web2py:Mail.send failure:{'some@email': (451, 'Sender rate 78.5
 of 50 messages per 5m')}


 do you know what could be causing this?

 On Tuesday, December 4, 2012 1:55:39 PM UTC+2, Aurelijus Useckas wrote:

 Yes, I've turned the TLS off and now it works :)

 thanks for your very valuable tips!

 On Tuesday, December 4, 2012 1:45:41 PM UTC+2, Niphlod wrote:


 On Tuesday, December 4, 2012 12:25:00 PM UTC+1, Aurelijus Useckas wrote:

 Gmail server gives an error of:
 *No SSL support included in this Python*

 I'm using 2.6v of Python, doesn't it support it?


 It should, in theory, if openssl headers are compiled into the
 distribution you have. That's all a different problem



 ordinary server gives an error of:
 *STARTTLS extension not supported by server.*

 Would it be possible to somehow bypass the STARTTLS initialization?
 I'm good with simple smtp.


 tls=False on the server istantiation or settings.tls = False in db.py
 . By default it's true for security measures.



 btw server.result = {}

 thnx

 On Tuesday, December 4, 2012 12:35:25 PM UTC+2, Niphlod wrote:

 BTW: all of these are showing that all of them return *False*!
 ...what python version are you using ? The first log shows that
 no SSL is available.
 Please print both server.result and server.error

  --





-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-03 Thread Aurelijus Useckas
Thanx for a tip Niphlod,

Here's the output:

 send: 'ehlo [127.0.1.1]\r\n'
reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
reply: '250-SIZE 35882577\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-STARTTLS\r\n'
reply: '250 ENHANCEDSTATUSCODES\r\n'
reply: retcode (250); Msg: mx.google.com at your service, [95.244.128.226]
SIZE 35882577
8BITMIME
STARTTLS
ENHANCEDSTATUSCODES
send: 'STARTTLS\r\n'
..  File console, line 1
send: 'ehlo [127.0.1.1]\r\n'
^
SyntaxError: invalid syntax
   File console, line 1
reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
 ^
SyntaxError: invalid syntax
   File console, line 1
reply: '250-SIZE 35882577\r\n'
 ^
SyntaxError: invalid syntax
   File console, line 1
reply: '250-8BITMIME\r\n'
 ^
SyntaxError: invalid syntax
   File console, line 1
reply: '250-STARTTLS\r\n'
 ^
SyntaxError: invalid syntax
   File console, line 1
reply: '250 ENHANCEDSTATUSCODES\r\n'
 ^
SyntaxError: invalid syntax
   File console, line 1
reply: retcode (250); Msg: mx.google.com at your service, [95.244.
128.226]
 ^
SyntaxError: invalid syntax
   File console, line 1
SIZE 35882577
^
SyntaxError: invalid syntax
   File console, line 1
8BITMIME
   ^
SyntaxError: invalid syntax
 Traceback (most recent call last):
  File console, line 1, in module
NameError: name 'STARTTLS' is not defined
 Traceback (most recent call last):
  File console, line 1, in module
NameError: name 'ENHANCEDSTATUSCODES' is not defined
   File console, line 1
send: 'STARTTLS\r\n'
^
SyntaxError: invalid syntax
 send: 'ehlo [127.0.1.1]\r\n'
  File console, line 1
..send: 'ehlo [127.0.1.1]\r\n'
^


Could you help me to figure out what's wrong?

On Monday, December 3, 2012 1:29:33 AM UTC+2, Niphlod wrote:

 let's inspect the code: if the exception has something to do with an error 
 related to sending the email, the value returned is always True. 
 That means that if (and that's not your case) there's something wrong with 
 body, sender, cc, etc, you would see an exception. Given instead that there 
 are no errors with the parameters you're using (because your rtn is True), 
 if there are errors sending the email they are stored into mail.error 
 (usually the entire traceback). 
 If that's None, by all means the mail server (or whatever you're 
 connecting to) is responding something like ok, I queued it.
 To inspect the problem further, please add a line in gluon/tools.py


 smtp_args = self.settings.server.split(':')
 if self.settings.ssl:
 server = smtplib.SMTP_SSL(*smtp_args)
 else:
 server = smtplib.SMTP(*smtp_args)
 server.set_debuglevel(1)#added line

 That will print on stderr all the raw commands sent to the mail server. 
 You can try sending an email just entering the shell of your app with 
 web2py.py -M -S yourappname and then 
 mail.send('t...@example.comjavascript:', 
 'subject', 'test body') or, cd-ing into web2py.py folder and

 web2py$ python
 Python 2.6.5 (r265:79063, Oct  1 2012, 22:04:36) 
 [GCC 4.4.3] on linux2
 Type help, copyright, credits or license for more information.
  from gluon.tools import Mail
  server = Mail('smtp.gmail.com:587', 'your...@gmail.com javascript:', 
 'youruser:password')
  server.send('t...@example.com javascript:', 'subject', 'test body')
 following this, something like 
 send: 'ehlo [127.0.1.1]\r\n'
 reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
 reply: '250-SIZE 35882577\r\n'
 reply: '250-8BITMIME\r\n'
 reply: '250-STARTTLS\r\n'
 reply: '250 ENHANCEDSTATUSCODES\r\n'
 reply: retcode (250); Msg: mx.google.com at your service, [95.244.128.226]
 SIZE 35882577
 8BITMIME
 STARTTLS
 ENHANCEDSTATUSCODES
 send: 'STARTTLS\r\n'
 ..

 should appear if the connection can be established with google servers.







 On Sunday, December 2, 2012 10:03:44 PM UTC+1, Aurelijus Useckas wrote:

 it only returns True. I'm beginning to guess there's smthng wrong with 
 some firewalls ISP has placed

 On Sunday, December 2, 2012 9:54:40 PM UTC+2, Niphlod wrote:

 and the rtn ? it's strange that no errors are returned because that 
 would mean that the mail library didn't catch the error (i.e. no error 
 messages were returned by the mail server)

 On Sunday, December 2, 2012 1:57:22 PM UTC+1, Aurelijus Useckas wrote:

 yes, it gives very little info:

 In [3] : print mail.result
 {}

 In [4] : print mail.error
 None
  

 On Friday, November 30, 2012 1:42:16 PM UTC+2, Niphlod wrote:

 did you try to see what errors you get back ?

 rtn = mail.send('y...@example.com',
   'Message subject',
   'Plain text body of the message')

 print rtn
 print mail.result
 print mail.error 

 ?

 Il giorno venerdì 30 novembre 2012 11:16:00 UTC+1, Aurelijus Useckas 
 ha scritto:

 nope... I'm 

[web2py] Re: Unable to send emails (mail.send) from server

2012-12-03 Thread Niphlod
STOP!
you should have only executed

from gluon.tools import Mail
server = Mail('smtp.gmail.com:587', 'your...@gmail.com', 'youruser:password'
)
server.send('t...@example.com', 'subject', 'test body')

and copied the output here. 
You seem to have entered in the console my example output, that is NOT 
something you want to enter in a shell :P
We want to read the shell after those 3 lines to see what is going to 
happen: mine was only an example on what a successful connection prints.


On Monday, December 3, 2012 4:52:16 PM UTC+1, Aurelijus Useckas wrote:

 Thanx for a tip Niphlod,

 Here's the output:

  send: 'ehlo [127.0.1.1]\r\n'
 reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
 reply: '250-SIZE 35882577\r\n'
 reply: '250-8BITMIME\r\n'
 reply: '250-STARTTLS\r\n'
 reply: '250 ENHANCEDSTATUSCODES\r\n'
 reply: retcode (250); Msg: mx.google.com at your service, [95.244.128.226]
 SIZE 35882577
 8BITMIME
 STARTTLS
 ENHANCEDSTATUSCODES
 send: 'STARTTLS\r\n'
 ..  File console, line 1
 send: 'ehlo [127.0.1.1]\r\n'
 ^
 SyntaxError: invalid syntax
File console, line 1
 reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
  ^
 SyntaxError: invalid syntax
File console, line 1
 reply: '250-SIZE 35882577\r\n'
  ^
 SyntaxError: invalid syntax
File console, line 1
 reply: '250-8BITMIME\r\n'
  ^
 SyntaxError: invalid syntax
File console, line 1
 reply: '250-STARTTLS\r\n'
  ^
 SyntaxError: invalid syntax
File console, line 1
 reply: '250 ENHANCEDSTATUSCODES\r\n'
  ^
 SyntaxError: invalid syntax
File console, line 1
 reply: retcode (250); Msg: mx.google.com at your service, [95.244.
 128.226]
  ^
 SyntaxError: invalid syntax
File console, line 1
 SIZE 35882577
 ^
 SyntaxError: invalid syntax
File console, line 1
 8BITMIME
^
 SyntaxError: invalid syntax
  Traceback (most recent call last):
   File console, line 1, in module
 NameError: name 'STARTTLS' is not defined
  Traceback (most recent call last):
   File console, line 1, in module
 NameError: name 'ENHANCEDSTATUSCODES' is not defined
File console, line 1
 send: 'STARTTLS\r\n'
 ^
 SyntaxError: invalid syntax
  send: 'ehlo [127.0.1.1]\r\n'
   File console, line 1
 ..send: 'ehlo [127.0.1.1]\r\n'
 ^


 Could you help me to figure out what's wrong?

 On Monday, December 3, 2012 1:29:33 AM UTC+2, Niphlod wrote:

 let's inspect the code: if the exception has something to do with an 
 error related to sending the email, the value returned is always True. 
 That means that if (and that's not your case) there's something wrong 
 with body, sender, cc, etc, you would see an exception. Given instead that 
 there are no errors with the parameters you're using (because your rtn is 
 True), if there are errors sending the email they are stored into 
 mail.error (usually the entire traceback). 
 If that's None, by all means the mail server (or whatever you're 
 connecting to) is responding something like ok, I queued it.
 To inspect the problem further, please add a line in gluon/tools.py


 smtp_args = self.settings.server.split(':')
 if self.settings.ssl:
 server = smtplib.SMTP_SSL(*smtp_args)
 else:
 server = smtplib.SMTP(*smtp_args)
 server.set_debuglevel(1)#added line

 That will print on stderr all the raw commands sent to the mail server. 
 You can try sending an email just entering the shell of your app with 
 web2py.py -M -S yourappname and then mail.send('t...@example.com', 
 'subject', 'test body') or, cd-ing into web2py.py folder and

 web2py$ python
 Python 2.6.5 (r265:79063, Oct  1 2012, 22:04:36) 
 [GCC 4.4.3] on linux2
 Type help, copyright, credits or license for more information.
  from gluon.tools import Mail
  server = Mail('smtp.gmail.com:587', 'your...@gmail.com', 
 'youruser:password')
  server.send('t...@example.com', 'subject', 'test body')
 following this, something like 
 send: 'ehlo [127.0.1.1]\r\n'
 reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
 reply: '250-SIZE 35882577\r\n'
 reply: '250-8BITMIME\r\n'
 reply: '250-STARTTLS\r\n'
 reply: '250 ENHANCEDSTATUSCODES\r\n'
 reply: retcode (250); Msg: mx.google.com at your service, [95.244.128.226
 ]
 SIZE 35882577
 8BITMIME
 STARTTLS
 ENHANCEDSTATUSCODES
 send: 'STARTTLS\r\n'
 ..

 should appear if the connection can be established with google servers.







 On Sunday, December 2, 2012 10:03:44 PM UTC+1, Aurelijus Useckas wrote:

 it only returns True. I'm beginning to guess there's smthng wrong with 
 some firewalls ISP has placed

 On Sunday, December 2, 2012 9:54:40 PM UTC+2, Niphlod wrote:

 and the rtn ? it's strange that no errors are returned because that 
 would mean that the mail library didn't catch the error (i.e. no error 
 messages were returned by 

[web2py] Re: Unable to send emails (mail.send) from server

2012-12-02 Thread Aurelijus Useckas
yes, it gives very little info:

In [3] : print mail.result
{}

In [4] : print mail.error
None
 

On Friday, November 30, 2012 1:42:16 PM UTC+2, Niphlod wrote:

 did you try to see what errors you get back ?

 rtn = mail.send('y...@example.com javascript:',
   'Message subject',
   'Plain text body of the message')

 print rtn
 print mail.result
 print mail.error 

 ?

 Il giorno venerdì 30 novembre 2012 11:16:00 UTC+1, Aurelijus Useckas ha 
 scritto:

 nope... I'm running a linux. Virus free environment. No need for McAfee ;)

 Thnx anyway guys, I guess I'll check with my provider. It has to be their 
 fault.  

 On Thursday, November 29, 2012 3:36:09 PM UTC+2, Mark wrote:

 If McAfee is running on the server, McAfee blocked the emails sending 
 from web2py, which isn't on the whitelist of McAfee. Try to change 
 web2py.exe into apache.exe

 On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas 
 wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host 
 (v2.2.1) and the server (v2.2.1 as well). Local version handles auth mail 
 (mail.send) very well, but the app which is running on server is unable to 
 send anything. 

 This must be something with the server but I'm not sure what and how to 
 ask?? BTW the server is dedicated, I myself have deployed a web2py on it.

 Thank you in advance! 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-02 Thread Niphlod
and the rtn ? it's strange that no errors are returned because that would 
mean that the mail library didn't catch the error (i.e. no error messages 
were returned by the mail server)

On Sunday, December 2, 2012 1:57:22 PM UTC+1, Aurelijus Useckas wrote:

 yes, it gives very little info:

 In [3] : print mail.result
 {}

 In [4] : print mail.error
 None
  

 On Friday, November 30, 2012 1:42:16 PM UTC+2, Niphlod wrote:

 did you try to see what errors you get back ?

 rtn = mail.send('y...@example.com',
   'Message subject',
   'Plain text body of the message')

 print rtn
 print mail.result
 print mail.error 

 ?

 Il giorno venerdì 30 novembre 2012 11:16:00 UTC+1, Aurelijus Useckas ha 
 scritto:

 nope... I'm running a linux. Virus free environment. No need for McAfee 
 ;)

 Thnx anyway guys, I guess I'll check with my provider. It has to be 
 their fault.  

 On Thursday, November 29, 2012 3:36:09 PM UTC+2, Mark wrote:

 If McAfee is running on the server, McAfee blocked the emails sending 
 from web2py, which isn't on the whitelist of McAfee. Try to change 
 web2py.exe into apache.exe

 On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas 
 wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host 
 (v2.2.1) and the server (v2.2.1 as well). Local version handles auth mail 
 (mail.send) very well, but the app which is running on server is unable 
 to 
 send anything. 

 This must be something with the server but I'm not sure what and how 
 to ask?? BTW the server is dedicated, I myself have deployed a web2py on 
 it.

 Thank you in advance! 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-02 Thread Aurelijus Useckas
it only returns True. I'm beginning to guess there's smthng wrong with some 
firewalls ISP has placed

On Sunday, December 2, 2012 9:54:40 PM UTC+2, Niphlod wrote:

 and the rtn ? it's strange that no errors are returned because that would 
 mean that the mail library didn't catch the error (i.e. no error messages 
 were returned by the mail server)

 On Sunday, December 2, 2012 1:57:22 PM UTC+1, Aurelijus Useckas wrote:

 yes, it gives very little info:

 In [3] : print mail.result
 {}

 In [4] : print mail.error
 None
  

 On Friday, November 30, 2012 1:42:16 PM UTC+2, Niphlod wrote:

 did you try to see what errors you get back ?

 rtn = mail.send('y...@example.com',
   'Message subject',
   'Plain text body of the message')

 print rtn
 print mail.result
 print mail.error 

 ?

 Il giorno venerdì 30 novembre 2012 11:16:00 UTC+1, Aurelijus Useckas ha 
 scritto:

 nope... I'm running a linux. Virus free environment. No need for McAfee 
 ;)

 Thnx anyway guys, I guess I'll check with my provider. It has to be 
 their fault.  

 On Thursday, November 29, 2012 3:36:09 PM UTC+2, Mark wrote:

 If McAfee is running on the server, McAfee blocked the emails sending 
 from web2py, which isn't on the whitelist of McAfee. Try to change 
 web2py.exe into apache.exe

 On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas 
 wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host 
 (v2.2.1) and the server (v2.2.1 as well). Local version handles auth 
 mail 
 (mail.send) very well, but the app which is running on server is unable 
 to 
 send anything. 

 This must be something with the server but I'm not sure what and how 
 to ask?? BTW the server is dedicated, I myself have deployed a web2py on 
 it.

 Thank you in advance! 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-12-02 Thread Niphlod
let's inspect the code: if the exception has something to do with an error 
related to sending the email, the value returned is always True. 
That means that if (and that's not your case) there's something wrong with 
body, sender, cc, etc, you would see an exception. Given instead that there 
are no errors with the parameters you're using (because your rtn is True), 
if there are errors sending the email they are stored into mail.error 
(usually the entire traceback). 
If that's None, by all means the mail server (or whatever you're connecting 
to) is responding something like ok, I queued it.
To inspect the problem further, please add a line in gluon/tools.py


smtp_args = self.settings.server.split(':')
if self.settings.ssl:
server = smtplib.SMTP_SSL(*smtp_args)
else:
server = smtplib.SMTP(*smtp_args)
server.set_debuglevel(1)#added line

That will print on stderr all the raw commands sent to the mail server. 
You can try sending an email just entering the shell of your app with 
web2py.py -M -S yourappname and then mail.send('t...@example.com', 'subject', 
'test body') or, cd-ing into web2py.py folder and

web2py$ python
Python 2.6.5 (r265:79063, Oct  1 2012, 22:04:36) 
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
 from gluon.tools import Mail
 server = Mail('smtp.gmail.com:587', 'youru...@gmail.com', 
'youruser:password')
 server.send('t...@example.com', 'subject', 'test body')
following this, something like 
send: 'ehlo [127.0.1.1]\r\n'
reply: '250-mx.google.com at your service, [95.244.128.226]\r\n'
reply: '250-SIZE 35882577\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-STARTTLS\r\n'
reply: '250 ENHANCEDSTATUSCODES\r\n'
reply: retcode (250); Msg: mx.google.com at your service, [95.244.128.226]
SIZE 35882577
8BITMIME
STARTTLS
ENHANCEDSTATUSCODES
send: 'STARTTLS\r\n'
..

should appear if the connection can be established with google servers.







On Sunday, December 2, 2012 10:03:44 PM UTC+1, Aurelijus Useckas wrote:

 it only returns True. I'm beginning to guess there's smthng wrong with 
 some firewalls ISP has placed

 On Sunday, December 2, 2012 9:54:40 PM UTC+2, Niphlod wrote:

 and the rtn ? it's strange that no errors are returned because that would 
 mean that the mail library didn't catch the error (i.e. no error messages 
 were returned by the mail server)

 On Sunday, December 2, 2012 1:57:22 PM UTC+1, Aurelijus Useckas wrote:

 yes, it gives very little info:

 In [3] : print mail.result
 {}

 In [4] : print mail.error
 None
  

 On Friday, November 30, 2012 1:42:16 PM UTC+2, Niphlod wrote:

 did you try to see what errors you get back ?

 rtn = mail.send('y...@example.com',
   'Message subject',
   'Plain text body of the message')

 print rtn
 print mail.result
 print mail.error 

 ?

 Il giorno venerdì 30 novembre 2012 11:16:00 UTC+1, Aurelijus Useckas ha 
 scritto:

 nope... I'm running a linux. Virus free environment. No need for 
 McAfee ;)

 Thnx anyway guys, I guess I'll check with my provider. It has to be 
 their fault.  

 On Thursday, November 29, 2012 3:36:09 PM UTC+2, Mark wrote:

 If McAfee is running on the server, McAfee blocked the emails sending 
 from web2py, which isn't on the whitelist of McAfee. Try to change 
 web2py.exe into apache.exe

 On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas 
 wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host 
 (v2.2.1) and the server (v2.2.1 as well). Local version handles auth 
 mail 
 (mail.send) very well, but the app which is running on server is unable 
 to 
 send anything. 

 This must be something with the server but I'm not sure what and how 
 to ask?? BTW the server is dedicated, I myself have deployed a web2py 
 on it.

 Thank you in advance! 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-11-30 Thread Aurelijus Useckas
Yes, I am able to telnet to gmail smtp

On Thursday, November 29, 2012 12:08:08 PM UTC+2, Niphlod wrote:

 is your server able to reach gmail's smtps servers ?

 On Thursday, November 29, 2012 10:46:12 AM UTC+1, Aurelijus Useckas wrote:

 External smtp, gmail



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-11-30 Thread Aurelijus Useckas
nope... I'm running a linux. Virus free environment. No need for McAfee ;)

Thnx anyway guys, I guess I'll check with my provider. It has to be their 
fault.  

On Thursday, November 29, 2012 3:36:09 PM UTC+2, Mark wrote:

 If McAfee is running on the server, McAfee blocked the emails sending from 
 web2py, which isn't on the whitelist of McAfee. Try to change web2py.exe 
 into apache.exe

 On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host 
 (v2.2.1) and the server (v2.2.1 as well). Local version handles auth mail 
 (mail.send) very well, but the app which is running on server is unable to 
 send anything. 

 This must be something with the server but I'm not sure what and how to 
 ask?? BTW the server is dedicated, I myself have deployed a web2py on it.

 Thank you in advance! 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-11-30 Thread Niphlod
did you try to see what errors you get back ?

rtn = mail.send('y...@example.com',
  'Message subject',
  'Plain text body of the message')

print rtn
print mail.result
print mail.error 

?

Il giorno venerdì 30 novembre 2012 11:16:00 UTC+1, Aurelijus Useckas ha 
scritto:

 nope... I'm running a linux. Virus free environment. No need for McAfee ;)

 Thnx anyway guys, I guess I'll check with my provider. It has to be their 
 fault.  

 On Thursday, November 29, 2012 3:36:09 PM UTC+2, Mark wrote:

 If McAfee is running on the server, McAfee blocked the emails sending 
 from web2py, which isn't on the whitelist of McAfee. Try to change 
 web2py.exe into apache.exe

 On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas 
 wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host 
 (v2.2.1) and the server (v2.2.1 as well). Local version handles auth mail 
 (mail.send) very well, but the app which is running on server is unable to 
 send anything. 

 This must be something with the server but I'm not sure what and how to 
 ask?? BTW the server is dedicated, I myself have deployed a web2py on it.

 Thank you in advance! 



-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-11-29 Thread Aurelijus Useckas
External smtp, gmail

-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-11-29 Thread Mark
If McAfee is running on the server, McAfee blocked the emails sending from 
web2py, which isn't on the whitelist of McAfee. Try to change web2py.exe 
into apache.exe

On Wednesday, November 28, 2012 10:20:55 AM UTC-5, Aurelijus Useckas wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host (v2.2.1) 
 and the server (v2.2.1 as well). Local version handles auth mail 
 (mail.send) very well, but the app which is running on server is unable to 
 send anything. 

 This must be something with the server but I'm not sure what and how to 
 ask?? BTW the server is dedicated, I myself have deployed a web2py on it.

 Thank you in advance! 


-- 





[web2py] Re: Unable to send emails (mail.send) from server

2012-11-28 Thread Niphlod
what do you use to send mails ? postfix? exim ? external smtp ?

On Wednesday, November 28, 2012 4:20:55 PM UTC+1, Aurelijus Useckas wrote:

 Hey, strange situation. Would apreciate your help...

 I have 2 identical versions of the same app running on local host (v2.2.1) 
 and the server (v2.2.1 as well). Local version handles auth mail 
 (mail.send) very well, but the app which is running on server is unable to 
 send anything. 

 This must be something with the server but I'm not sure what and how to 
 ask?? BTW the server is dedicated, I myself have deployed a web2py on it.

 Thank you in advance! 


--