简体   繁体   English

确定电子邮件发件人并发送电子邮件

[英]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? 我该如何更改并确保不再弹出任何窗口?

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. 除了使用服务器端电子邮件解决方案外,您别无选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM