0

I want a user to provide me with some information. By clicking on send I want this information to be sent to my inbox.

How can I set the sender of an email? Is that possible in the frontend?

<div class="col-xs-9 signupToUnlock">
        <input type="email" placeholder="Enter you name" ng-model="emailUnlock">
        <button class="btn"
                type="submit"
                ng-click="sendEmail(emailUnlock)"
                ng-disabled="myForm.$error.email">Send</button>
      </div>

and in the controller

 $scope.emailUnlock='';
          $scope.sendEmail=function(email,subject,body){
            var link = "mailto:maximilian@tripdelta.com"
              + "?subject=" + email

            window.location.href = link;
          };

When the user clicks this, obviously his email window pops up and the sender is himself. How can I change that and make sure no window pops up anymore?

Dribel
  • 465
  • 1
  • 10
  • 24
  • You can't. You'd have to build a server-side form to send the E-Mail to do that. – Pekka Dec 23 '15 at 13:57
  • I already thought so...Too bad. Can you think of another easy way to get around a server side solution? – Dribel Dec 23 '15 at 13:58
  • Not really, no. Sending E-Mail from the client is necessarily subject to a lot of restrictions. – Pekka Dec 23 '15 at 14:01
  • You could use a third-party service like https://formspree.io/ but not sure if you can set the sender address there – Pekka Dec 23 '15 at 14:02
  • 1
    mmh alright. I just wanted a solution that does not require the user to confirm his email address... thanks a lot for your quick help – Dribel Dec 23 '15 at 14:03
  • No problem, I'll add an answer. – Pekka Dec 23 '15 at 14:04

1 Answers1

1

You can't, for the obvious security reasons - if this were possible, web sites could send E-Mail through users' E-Mail clients without them knowing.

You'll have no option but to use a server-side E-Mail solution.

Pekka
  • 442,112
  • 142
  • 972
  • 1,088