7

I am a Python developer, but the circumstances of a project I am working on now, oblige me to find a solution in Node.js

This is the easy python code to send mail but, is there a google app engine way like this in nodejs without use an intermediary service like mailJet or sendGrid?

def send(recipient, sender, subject, body):
isHTML=True
print("recep: "+recipient)
logging.debug(u'Sending mail {} to {}'.format(subject, 
unicode(recipient)).encode(u'utf-8'))

message = mail.EmailMessage(
    sender=sender,
    subject=subject,
    to=recipient
)

if isHTML:
    message.html = body
else:
    message.body = body

message.check_initialized()
message.send()

Thank's for your understanding and help.

Andresse Njeungoue
  • 608
  • 1
  • 5
  • 19

1 Answers1

9

The simple example you posted uses the app engine specific Mail API, available only in the first generation standard environment (python 2.7, java 8, php 5.5 and go 1.9 - see the tabs in the referenced documentation page).

Node.js support was added only in the second generation standard environment, which has no such API available.

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97