0

I'm learning Angular 4 (first experience with it), and building an webapp that send an email through a contact form.

I understand the logic using PHP, but don't know if its the right way to use with Angular.

Can anyone give me directions? I need an specif host to do it? An specific server? Lib?

I'm in the dark.

Rafael de Castro
  • 888
  • 4
  • 16
  • 37
  • 1
    If you want to directly send the email you'll need to have a webserver send it, and not the client. One of the simplest routes is to have your server host a PHP page that accepts a POST from Angular and the PHP then handles the sending of the email. – Z. Bagley Nov 21 '17 at 15:02
  • Possible duplicate of [Sending Email from Angular 2](https://stackoverflow.com/questions/43192772/sending-email-from-angular-2) – Lucio Nov 21 '17 at 15:08

1 Answers1

0

Angular is a front-end framework. It's meant to run on the client's computer.

This means you won't be able to send an email with Angular.

If you want to send an email with Angular, you will need a back-end that has access to an SMTP server. You can do it with NodeJS for instance, but it's up to you to choose !

(Also, some web services exist, such as mailgun, maybe you could take a look at it too)