【问题标题】:Python send mail on button click Google App EnginePython发送邮件按钮点击Google App Engine
【发布时间】:2014-10-15 11:28:14
【问题描述】:

沮丧:我搜索了大多数网站,但仍然找不到任何答案。

信息:我对 Python 一无所知。

我想要编码的内容:我想在点击 HTML 网页的按钮时使用 Python 发送邮件。它不应该像 html 中的“mailto”那样打开用户的电子邮件客户端,而是直接向我发送邮件。该网络应用程序使用 Google App Engine 托管(网址类似于 www.example.appspot.com)。我还想将文本框和单选组中的值发送到收件人的电子邮件地址。

HTML 表单:

<form method="post" id="rsvpForm" action="">
<div class="row half">
    <div class="6u">
        <input type="text" name="name" id="name" placeholder="Name" />
    </div>
    <div class="6u">
        <input type="text" name="email" id="email" placeholder="Email" />
    </div>
</div>
<br/>
<div>
    <div class="12u">
        <span>Radio grp 1</span>
    </div>
</div>
<div class="row half">
    <div class="12u">
        <input type="radio" name="attendance" value="Options">Options<br>
    </div>
</div>
<br/>
<div class="row half">
    <div class="12u">
        <textarea name="message" id="message" placeholder="Message or wishes" rows="3">
        </textarea>
    </div>
</div>
<div class="row half">
    <div class="12u">
        <ul class="actions">
            <li><input type="submit" class="style1" value="Send" id="sendMessage"/>
            </li>
            <li><input type="reset" class="style2" value="Reset" /></li>
        </ul>
    </div>
</div>

使用的参考资料:我使用这个网站来托管网站

http://www.labnol.org/internet/host-website-on-google-app-engine/18801/

请帮助我。我不想使用 PHP

【问题讨论】:

    标签: python html google-app-engine email


    【解决方案1】:

    从 GAE Python 发送电子邮件非常容易,但您只发布 HTML 代码,您是否有 Python 处理程序来执行此操作?如果没有,我建议学习和测试谷歌提供的所有这些教程:https://developers.google.com/appengine/docs/python/gettingstartedpython27/introduction

    这是一个发送电子邮件表单GAE python的示例:https://developers.google.com/appengine/docs/python/mail/?hl=fr#Python_Sending_mail_in_Python

    【讨论】:

    • 非常感谢 Olituks。非常感谢您的帮助。当然,我会查看您提供的链接。 Python 处理程序:我正在使用与我提供的参考站点完全相同的代码。一切都一样,只是根据我的喜好配置了 html 页面。
    猜你喜欢
    • 2015-02-25
    • 2012-07-08
    • 1970-01-01
    • 2016-12-04
    • 1970-01-01
    • 2010-10-27
    • 1970-01-01
    • 2011-10-22
    • 2016-10-27
    相关资源
    最近更新 更多