angularjsemailmail-servermail-sender

determine email sender and send email


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?


Solution

  • 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.