【问题标题】:How to get response to email which sent by an application?如何获得对应用程序发送的电子邮件的响应?
【发布时间】:2014-03-06 03:43:03
【问题描述】:

我有一个使用电子邮件进行调查的想法。但是没有想法去做。任何人都可以帮助我。我什至不知道这是否可行。

我有一个 Web 应用程序,它向该应用程序的某些用户(或任何其他人)发送电子邮件,询问一个简单的问题。这有点像调查。

例如:我发送的电子邮件有两个按钮。 。 (给定问题的答案)。就这样。所以我会把这封邮件发给很多人。我希望他们做出回应。 (是还是不是)。

有什么方法可以捕捉到人们的反应。我的意思是,如果读者点击 yes 按钮,我希望我的数据库据此更新它的表格。 我怎么能做这样的事情。

我怎样才能在电子邮件中嵌入类似按钮点击功能的东西。 ?

如何触发有关用户事件的应用程序。 ?

有没有办法实现这样的功能?? 请帮忙。提前致谢。

【问题讨论】:

    标签: php email httprequest html-email httpresponse


    【解决方案1】:

    您可以使用以下步骤来解决问题。

    • 创建一个动作以接受用户响应(是/否按钮单击)

    • 点击按钮(在电子邮件中创建一个链接,并在需要时使用 css 将其设为按钮)

    • 点击按钮记录结果

    例如:

    您的电子邮件如下所示

    Hi User,
    
       Bla bla ....
    
       Please click on any options
    
       <a href="example.com/emailresponse?opt=yes">Yes</a>
       <a href="example.com/emailresponse?opt=no">No</a>
    
    
    Regards,
    XXX
    

    创建一个 Servlet 来接受用户响应

    public class EmailResponse extends HttpServlet {
    
    
    protected void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
       String option = request.getParameter("opt");
       //Save user option into db
    
    }
    

    【讨论】:

      【解决方案2】:

      如果你使用 mvc 应用程序(asp.net) 您的电子邮件模板如下所示

      博士……

       <a href="www.myserver.com/EmailResponse?result=yes">Yes</a>
      
       <a href="www.myserver.com/EmailResponse?result=no">No</a>
      

      ... 谢谢

      您可以创建一个控制器来获取电子邮件响应...

      public class EmailResponseController : Controller
         {
          public ActionResult Index()
          {
              String result = Request.QueryString["result"];
              return View();
          }
      
      }
      

      【讨论】:

        【解决方案3】:

        最好的方法是让按钮转发到您服务器上的链接,然后使用 php 在您的服务器上注册。

        使用 HTML 将 Yes 按钮转发到“/surveyResult.php?result=yes”,将 No 按钮转发到“/surveyResult.php?result=no”。

        <a href="www.myserver.com/surveyResult.php?result=yes">Yes</a>
        <a href="www.myserver.com/surveyResult.php?result=no">No</a>
        

        在你的surveyResult.php中做这样的事情:

        <?php
        $result = $_GET["name"];
        [write the result to your mysql-database]
        ?>
        

        【讨论】:

        • 请选择一个答案作为正确答案,以便将此问题标记为已回答。
        • 更像是“接受”而不是“正确”。但是,是的,请这样做。
        猜你喜欢
        • 2010-12-20
        • 2021-12-27
        • 2013-03-13
        • 2010-12-02
        • 1970-01-01
        • 2020-11-04
        • 1970-01-01
        • 2013-09-21
        • 1970-01-01
        相关资源
        最近更新 更多