Start a new topic

Email is not getting sent

Hi,


I tried to sent email using Kinvey email module, below is the code snippet for the same.


function onRequest(request, response, modules){

  var email = modules.email;

  var to = 'receiver@gmail.com';

      modules.logger.info("Sending e-mail to: " + to);

      email.send('sender@gmail.com',

                   to,

                   'Test Email',

                    'Note: This is system generated notification. Please do not reply to this email.');

    response.continue();

}


But no email is received to my email address, also I am getting a 500 Request Timeout Error.

500 ERROR -- { "error": "BLTimeoutError", "description": "The Business Logic script did not complete. Please contact support", "debug": "The execution of a background task timed out." }


Please let me know if there is any issue with the code snippet or it is from the Kinvey Backend itself.


Anil,


There's 2 issues with your code:


1. On a custom endpoint you cannot use response.continue(), you should be calling response.complete().


2. When you're using gmail addresses, it is important that you own the sending email address (and you know that it's valid).


We just tested the functionality as working with some internal email addresses, but it failed when we tried to use test@gmail.com to a valid email recipient. 


Please let me know if this resolves your issues.


Thanks

Hi Damien,


As suggested I have replaced the response.continue() with response.complete(). And I am already using valid email addresses, I have mentioned sender@gmail.com and receiver@gmail.com only in this post.


These are valid email address in real.


After replacing with response.complete(), although there is no error in Kinvey Console, but the email is still not getting received.

Hi Damien,


If there are any updates on this, please let me know.


Also FYI, I am using an email address alerts@75fahrenheit.com in one of my Kinvey application. This email is a valid email but it does not exists, still I am able to receive email from this email address. So I guess, it is not important to own the sending email address. Only thing is the email address needs to be valid.


Thanks,

Anil


Anil, 


We are still looking into this, unfortunately we aren't able to reproduce the error at this time.  Have you tried using a non-gmail address for testing this?  There may be some sort of filtering done there.


Thanks,

Tried with non gmail account also, but no luck.

Anil, can you try using a real email account (not one that is valid, but one that maps to a mailbox that exists) on both ends (that you control) to ensure that the issue is not one imposed by our notifications provider?


Thanks,

Damien, I am using the emails for my own mailbox on both ends, but it is not really working.

Anil,


Is the email address you used the same one you used to sign up for the forums?  If not can you shoot me an email from the address that you used?  my email is damien@kinvey.com


Thanks,

You want me to shoot you an email from my mailbox or using the Kinvey custom endpoint written ?

From your inbox.  I want to do a check on my end to make sure that your mail isn't getting blocked for some reason.


thanks, 

Anil,


In a moment where I can only say "Whoops", I have to correct my earlier stance.  There does seem to be a bug in our implementation of email sending at this time.   We expect to have this fixed on Monday.


thanks,

OK.


Please keep me posted on this, once the bug is fixed.


Thanks,

Anil Saini

Anil,


This should be all set now.   Please let me know if it works properly for you.


Thanks again for reporting this issue to us.

Hi Damien,


I have checked the email sending and it is working well now.


Thanks for the help.


---

Anil Saini

Login or Signup to post a comment