站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Blog by Email
”
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
Xxf3325
(
讨论
|
贡献
)
2008年4月3日 (四) 10:40的版本
(
差异
)
←上一版本
|
最后版本
(
差异
) |
下一版本→
(
差异
)
跳转至:
导航
、
搜索
警告:您正在编辑的是本页面的旧版本。
如果您发布该更改,该版本后的所有更改都会丢失。
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
{{Rename}} __TOC__ WordPress可以用邮件写文章发送到博客上。要运行这个功能,你需要: #创建一个单独的电子邮件帐户,只用来给你的博客发送文章。 #设置WordPress接近那个帐户,并且 #设置WordPress发布来自电子邮件帐户的文章 使用最标准的电子邮件软件程序或者一个[[Wordpress:Weblog Client|博客软件]]-一个专门为通过邮件发送博客文章而设计的程序,你可以通过电子邮件来写博客。 '''注:'''WordPress2.2的用户遇到了通过电子邮件发表博客文章的麻烦。[http://trac.wordpress.org/ticket/4337 已经发布了一个补丁来解决这个问题。] <!-- HIDE THIS FIRST SECTION, which is redundant, until editing complete -- User:KatyCat, editor, 3/11/08 ==概况== #创建一个新的电子邮件帐户。 #在 选项 > 在 WordPress管理面板 中写文章 中设置[[Wordpress:Writing_Options_SubPanel#Post_via_e-mail|通过电子邮件写博客]]这样WordPress就可以接近那个帐户了。 #设置WordPress来将电子邮件发送到你创建的那个帐户上,就要做下面的步骤中的其中一个: #*在你发送电子邮件到你接收的地址后,立马打开你的网络浏览器到<nowiki>http://yourwebdomain/wordpressinstalldir/wp-mail.php</nowiki>;然后载入文章。你也许要刷新页面。 #* 使用如下面所描述的iframe命令行,在你的Wordpress页脚插入一些短的HTML代码,特别要自动化wp-mail.php核实你执行了以上的步骤;你可能要再次刷新一下页面来看到新的文章。 #*使用[http://www.skippy.net/blog/2005/05/26/plugin-wp-cron/ WP-Cron]WP-Mail插件. ''(注:这个在WP 2.2中看起来陈旧。)'' #*设置一个cron职位来定时地看看<tt><nowiki>http://yourwebdomain/wordpressinstalldir/wp-mail.php</nowiki></tt>使用一个命令行<tt>HTTP</tt>中介例如<tt>wget</tt>, <tt>curl</tt>,或者<tt>GET</tt>。 #*如果你的ISP使用.qmail,当一个电子邮件已经发送了的时候,使用一个.qmail文件直接访问wp-mail.php。 FINISH HIDING OVERVIEW --> ==通过电子邮件设置文章== ===第一步 – 创建一个电子邮件帐户=== # 从管理登录的位置登录到你的博客,你就是使用管理登录 来管理你的WordPress博客。 # 转到选项 > 写。 # Read the instructions under '''Post via e-mail''' at the bottom of the page. At the end of these instructions, #在页面的底部阅读一下'''通过电子邮件写博客'''。在这些说明的结尾,WordPress会给你三串随机排的数字,你可能想使用这些数字作为你创建的电子邮件帐户的注册名。<!-- (a.k.a. <strong>文章帐户</strong>) -->. # 在你的网络主机的邮件服务器或者一个单独的电子邮件服务器上创建一个新的电子邮件帐户,使用提供的数字串中的其中一串(或者你自己的保密的命令)作为用户名(也称作"登录名")。一个邮件服务器代表你来接受电子邮件,并且将电子邮件保存以便于提取。'''不要'''为这个帐户使用一些公共的免费的电子邮件服务器像雅虎,Hotmail,等等。 <div style="margin:20px; padding:10px; border:blue 1px solid">'''Note:''' 强烈推荐你使用一个"保密的" 地址—就是一个很难猜到的电子邮件帐户名而且只有你自己知道这个账户名,例如WordPress建议使用的这些地址。 任何电子邮件发送到这个地址,就会自动地粘贴到你的博客上。但是,要明白,有些电子邮件服务器不允许只含有数字的电子邮件帐户或者由一个数字开始的电子邮件帐户。请与你的网络主机核实一下。</div> ===第二步 – 设置WordPress接近你的新帐户=== # 当你创建好了新的电子邮件帐户后<!--(a.k.a. <strong>文章帐户</strong>) -->,返回到写选项面板并且填上你的网络主机供应商使用的'''电子邮件服务器''' 和 '''端口数字'''(如果你不知道这些,请查阅你的网络主机供应商的常见问题解答或者手册指南页面。端口数字通常是110.) #然后,为你的新帐户输入<i>登录名e</i>和<i>密码</i> <!-- (<strong>postaccount</strong>) -->.<br /><div style="margin:10px; padding:5px">'''NOTE:'''在登录名一栏,使用完整的电子邮件地址(例如,<tt><nowiki>user@example.com</nowiki></tt>)。</div> #给通过电子邮件上交的博客文章,选择一个默认分配的种类。 #点击'''更新选项''' 。 如果在你真正创建电子邮件帐户''之前'',你使用了[[Wordpress:Writing_Options_SubPanel#Post_via_e-mail|写选项 > 通过电子邮件写博客]]部分来指定电子邮件地址,请记住当你创建帐户时,要使用与你在那个部分规定的登录和密码。</div> ===第三步 – 发表你的电子邮件文章 === 你已经创建了新的电子邮件帐户而且设置了你的WordPress博客从那个帐户中接受电子邮件,但是你仍然需要设置WordPress来发表你的博客上的这些电子邮件信息。做一下以下中的一步: ===='''动手激活浏览器'''==== 在你向你的新的电子邮件帐户发送了一封电子邮件之后,立马转到以下的链接<tt><nowiki>http://example.com/installdir/wp-mail.php</nowiki></tt>。('''注:'''你每发一封新的文章,都要这样做。) ===='''浏览器自动激活'''==== 与动手激活浏览器相对的方法是在你的博客页脚添加以下的iframe代码: <code><iframe src="http://yourblogdomain/wordpressinstalldir/wp-mail.php" name="mailiframe" width="0" height="0" frameborder="0" scrolling="no" title=""></iframe></code> 编辑上面的代码行,这样它就能指向你的wp-mail.php 文件的位置。将这行代码添加到你使用的任何主题的目录上的footer.php 文件上。(不要放到一个HTML段落中)。 也许你要刷新你的博客以看到新的文章。新用户可能发现这个方法最管用。 If you're using or would like to use the [http://www.economysizegeek.com/wp-mail/ Postie Plugin] for WordPress, use the following iframe code, which will call Postie's check mail commands: <iframe src="http://yourblogdomain/wordpressinstalldir/wp-content/plugins/postie/get_mail.php?Submit=Run+Postie" name="mailiframe" width="0" height="0" frameborder="0" scrolling="no" title=""> </iframe> 如果你为或者是想为WordPress使用[http://www.economysizegeek.com/wp-mail/ Postie插件],使用下面的iframe代码,这个代码会访问Postie的检查邮件命令行: <iframe src="http://yourblogdomain/wordpressinstalldir/wp-content/plugins/postie/get_mail.php?Submit=Run+Postie" name="mailiframe" width="0" height="0" frameborder="0" scrolling="no" title=""> </iframe> Add this code to your footer, and the next time anyone goes to your blog, your new emails will be automatically posted, so you need to do nothing but send them. You may have to refresh the blog to see the changes. 将这个代码添加到你的页脚上,这样下次任何人访问你的博客的时候,你的新邮件会自动地粘贴上去。这样除了发送邮件外,你什么也不要做。你也许要刷新博客看看发生的变化。 ==== '''WP-Cron Plugin Activation''' ==== ==== '''WP-Cron 插件激活''' ==== Download, install, and activate the [http://skippy.net/plugin-wp-cron WP-Cron] Plugin. It will work in the background without user intervention to update your site about every 15 minutes. 下载,安装,激活[http://skippy.net/plugin-wp-cron WP-Cron]插件。它会在没有用户干涉的幕后工作,每15分钟更新一下你的站点。 ==== '''Cron Job Activation''' ==== ==== '''Cron Job 激活''' ==== Set up a UNIX cron job to have your blog periodically view <tt><nowiki>http://example.com/installdir/wp-mail.php</nowiki></tt> using a command-line HTTP agent like wget, curl or GET. The command to execute will look like: 设置一个UNIX cron职位使你的博客定时性地看<tt><nowiki>http://example.com/installdir/wp-mail.php</nowiki></tt>使用一个命令行像wget, curl 或者GET那样的HTTP中介。要执行的命令可能看起来像: <nowiki>wget -N http://example.com/installdir/wp-mail.php</nowiki> <nowiki>wget -N http://example.com/installdir/wp-mail.php</nowiki> If you use a different program than <tt>wget</tt>, substitute that program and its arguments for <tt>wget</tt> in this line. 如果你使用了一个与<tt>wget</tt>不同的程序,在这一行中将那个程序和它的论点替换为<tt>wget</tt> 。 '''Note:''' Another possibility is to run "php /full/path/to/wp-mail.php" in a cronjob. This will run the php-script using php, without the need for an extra program to run. (You are more likely authorized to run php than wget.) '''注:'''另一种可能性是在一个cronjob中运行"php /full/path/to/wp-mail.php"。这个会使用php来运行php-script,不需要一个额外的程序来运行。(你更可能被授权来运行php而不是wget) For more information about setting up a cron job, see: 更多的关于设置一个cron职位的信息,请看: * [http://www.unixgeeks.org/security/newbie/unix/cron-1.html Intro To Cron Jobs] * [http://www.unixgeeks.org/security/newbie/unix/cron-1.html 介绍 Cron 职位] * [http://www.uwsg.iu.edu/usail/automation/cron.html Automating tasks with cron services at USAIL] * [http://www.uwsg.iu.edu/usail/automation/cron.html USAIL上的cron服务的自动任务] * Your hosting provider's FAQ or manual pages * 你的主机供应商的常见问题解答或者手册页面 '''Note to Windows Users:''' There are similar programs to cron available if your host runs Windows. For example, [http://www.visualcron.com VisualCron], [http://cronw.sourceforge.net/ Cron for Windows] and [http://www.google.com/url?sa=U&start=2&q=http://sourceforge.net/projects/pycron/&e=1102&mr=8,2!619021,!a:sr4 pycron]. Consult these projects' documentation for further information. ''' Windows 用户注意:'''如果你的主机运行Windows,有与cron相似的程序。例如,[http://www.visualcron.com 可视的Cron], [http://cronw.sourceforge.net/ Windows 的Cron] 和[http://www.google.com/url?sa=U&start=2&q=http://sourceforge.net/projects/pycron/&e=1102&mr=8,2!619021,!a:sr4 pycron].更多信息,请参考一下这些项目的文件。 ==== '''Procmail Activation''' ==== ==== '''Procmail 激活''' ==== If your server uses [http://www.procmail.org/ procmail], a simple <tt>.procmailrc</tt> in the blogmailaccounts home directory will be sufficient: <nowiki> Shell=/bin/sh<br> MAILDIR=$HOME/.maildir/ DEFAULT=$MAILDIR :0 { :0Wc ./ :0 | wget -N http://example.com/installdir/wp-mail.php } </nowiki> 如果你的服务器使用 [http://www.procmail.org/ procmail],博客邮件帐户首页目录上一个简单的 <tt>.procmailrc</tt> 就足够了: <nowiki> Shell=/bin/sh<br> MAILDIR=$HOME/.maildir/ DEFAULT=$MAILDIR :0 { :0Wc ./ :0 | wget -N http://example.com/installdir/wp-mail.php } </nowiki> This could be more specific, such as capturing certain subject expressions. Check [http://www.procmail.org/ procmail] for more information. 这个可能更加地详细和明确,例如夺取一些特殊的主题表述。更多信息请查看[http://www.procmail.org/ procmail]。 ==== '''.qmail Activation''' ==== ==== '''.qmail 激活''' ==== If your server uses qmail to process e-mail, you may be able to use it to call wp-mail.php whenever an e-mail message is delivered. To do this, first create a small shell script to call wp-mail.php. You could call the file <tt>wp-mail</tt>: #!/bin/sh /bin/sh -c "sleep 5; /path/to/php /path/to/your/blog/wp-mail.php > /dev/null" & 如果你的服务器使用qmail来处理一个电子邮件,无论何时一封电子邮件发送了,你都可以用它来访问wp-mail.php。要做到这一点,首先创建一个小的shell脚本来访问wp-mail.php。你可以访问文件<tt>wp-mail</tt>: #!/bin/sh /bin/sh -c "sleep 5; /path/to/php /path/to/your/blog/wp-mail.php > /dev/null" & The <tt>sleep</tt> command causes a 5-second delay to allow qmail to finish processing the message before wp-mail.php is called. Note that the ampersand on the end of the line is required. The above script should go in your root directory, and the execute bit should be set (chmod 700). For debugging purposes, you could change <tt>/dev/null</tt> to a filename to save the output generated by wp-mail.php. <tt>sleep</tt>命令行,在允许qmail在wp-mail.php被访问之前完成处理信息,造成了5秒钟的延误。注意行结尾的&是必须的。以上的脚本应该归入到你的根目录上,而且执行的位应该设置为(chmod 700)。为了调适,你可以将<tt>/dev/null</tt>改为一个文件名,将由wp-mail.php产生的输出保存起来。 Then all you need to do create/modify the appropriate .qmail file to call your shell script. Add the following line to the .qmail file for your mailbox name: |/path/to/your/root/directory/wp-mail 然后你所要做的就是创建/更改合适的.qmail文件来访问你的shell脚本。为你的邮箱名的.qmail 文件加上以下这一行: /path/to/your/root/directory/wp-mail See your ISP's documentation for use of .qmail files. Naming conventions may vary for different ISPs. 看看.qmail 文件的你的ISP的文件使用。不同的ISPs命名传统可能不同。 ==Email Format== ==邮件格式== WordPress will use the Subject line of your email for the title of the post, and all body of the email will be used as the content of the post, with ''common HTML tags stripped''. WordPress will file the post under whichever category is selected for "Usual Category" in Step 1, and will use Site Admin as the poster. WordPress会将你的邮件的主题名作为文章的标题,邮件的所有部分会被用作文章的内容,''除去普通的HTML 标签''。WordPress会将第一步中任何选为"通常的 种类"中的种类下的文章归档,并且使用站点管理作为发送器。 Any images and attachments in your email will be posted inline. 你的邮件中的任何图像和附件都会被发送进来。 ==Testing== ==测试== To test your configuration, simply send an e-mail to <tt>yournewaccount@yourmaildomain</tt> (or to <tt>user@yourmaildomain</tt> if you used the <tt>.qmail</tt> forwarding setup). Then do the following: 测试你的配置,只要向<tt>yournewaccount@yourmaildomain</tt> (或者向 <tt>user@yourmaildomain</tt> 如果你使用<tt>.qmail</tt> 推进的配置)发送一封电子邮件。然后做下面的步骤: * If you have no automated system set up, simply view <tt><nowiki>http://example.com/installdir/wp-mail.php</nowiki></tt> in your browser. The script should tell you that it found an e-mail, and print details of the post it made. Then view your blog again to see your email posted. *如果你没有设置自动系统,只要在你的浏览器中看看<tt><nowiki>http://example.com/installdir/wp-mail.php</nowiki></tt>。脚本会告诉你它发现了一封电子邮件,并且印出了文章的详细信息。然后再次看看你的博客,看看粘贴进的邮件。 * If you are using an iframe code in your footer, refresh your browser to see the new post. *如果你在脚页中使用了iframe代码,刷新你的浏览器看看新的文章。 * If you are using WP-Cron, simply wait fifteen or twenty minutes. *如果你使用WP-Cron,只要等十五或者二十分钟就行了。 * If you have a cron job running, wait until the next time it's scheduled to run (or temporarily edit the cron job to make it run sooner). If you run tail <tt>-f /var/log/cron</tt> in a terminal, you'll be able to see the job create its log entry when it's finished running. When that happens, just view the site in your web browser to see your email posted. 如果你在运行一个cron任务,等到它下一次预定运行的时间(或者临时地编辑一下cron任务使它运行地更快)。如果你在一个终端运行后部<tt>-f /var/log/cron</tt>,当任务完成运行时,你可以看见任务创建的运行日志。到那时,只要在你的网络浏览器上看看你的站点,看看你发送发表上去的电子邮件。 ==Troubleshooting== ==发现并修理故障== If you receive the following error messages, follow the procedures below. 如果你收到了下面的错误信息,遵循以下的步骤。 '''Error Message:''' <pre>Ooops POP3: premature NOOP OK, NOT an RFC 1939 Compliant server</pre> '''Error Message:''' <pre>Ooops POP3: premature NOOP OK, NOT an RFC 1939 Compliant server</pre> For this error, open <tt>wp-includes/class-pop3.php</tt> and change this line: if($this->RFC1939) { to this: if(!$this->RFC1939) { 对于这一个错误,打开<tt>wp-includes/class-pop3.php</tt>并且将这一行: if($this->RFC1939) { 改为: if(!$this->RFC1939) { Note the exclamation point. 注意一下那个感叹号。 '''Error Message:''' <tt>There does not seem to be any new mail</tt> '''错误消息:''' <tt>好像没有什么新的邮件</tt> This error is a bit of a misnomer - the test just checks to see if anything was retrieved. 这个错误有点用词不当-测试只是检查看看有没有什么重新得到了什么东西。 If you're feeling adventuresome, open <pre>wp-mail.php</pre> and search for: <pre>$count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));</pre> 如果你觉得有一点冒险,打开<pre>wp-mail.php</pre>并且搜索: <pre>$count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));</pre> Change the lines following it to something like: 将它下面的行改为: <pre> if (0 == $count) : echo "There does not seem to be any new mail. <br/>\n"; echo "count = $count<br/> \n"; echo "$pop3->ERROR \n"; exit; endif; </pre> <pre> if (0 == $count) : echo "看起来好像没有什么新邮件。 <br/>\n"; echo "count = $count<br/> \n"; echo "$pop3->ERROR \n"; exit; endif; </pre> You'll then be presented with a more informative message. 然后你得到一个更详细的讯息。 The e-mail server may be refusing connections that attempt to provide an unencrypted password - like POP3. If your webserver and e-mail server are on the same physical computer, you can specify <tt>localhost</tt> or <tt>127.0.0.1</tt> as the mail server. That traffic is assumed to be OK without encryption because it never traveled across the network. 电子邮件服务器可能会拒绝试着提供一个加密的密码-像POP3的连接。也许你的网络服务器和你的电子邮件服务器都真实地在一台电脑上,你可以将<tt>本地主机</tt> or <tt>127.0.0.1</tt>规定为邮箱服务器。假定流量是好的,没有加密,因为它从来不在网络中流经。 ==Extensions and Add-ons== ==扩充和附件== There are several add-ons and hacks that will extend the capabilities of posting by e-mail with WordPress. Some of these may involve changing the core files, so do it carefully and '''make backups'''. 有几个附件和插件会扩展WordPress通过电子邮件写博客的能力。其中的一些可能包括改变核心软件,因此要仔细地做,同时'''做文件备份'''。 ===Enhanced Functionality Hack=== ===增强功能性插件=== One replacement file for the original <tt>wp-mail.php</tt> file has been created: * [http://www.economysizegeek.com/?page_id=395 Postie] supports posting to categories, automatic removal of email signatures, POP3/IMAL (+SSL) and more. 原<tt>wp-mail.php</tt>文件的替换文件已经创建了: * [http://www.economysizegeek.com/?page_id=395 Postie]支持向种类发送,自动移动电子邮件签名,POP3/IMAL (+SSL)以及更多的。 ===Hack E-mail Format=== ===破解电子邮件形式=== The following enhancements may be made to your <tt>wp-mail.php</tt> so your e-mail will be translated into metadata for your post: 你的<tt>wp-mail.php</tt>要做以下的改进,这样你的电子邮件中的文章会被翻译成元数据: ;Sender's e-mail address :The enhanced <tt>wp-mail.php</tt> looks up the email address you send from in its user database. If there is a match with any user there, it files the post under that user. If there is no match, it drops the e-mail and does not create a post in the blog. (Great for security and spam prevention.) It is set by the '''From''' field. ;发送者的电子邮件地址:提高了的<tt>wp-mail.php</tt>在它的用户数据库中查找你发送的电子邮件地址。如果对那儿的用户有一个匹配,它就会吧文章归档到那个用户的下面。如果没有匹配,它扔下电子邮件,在博客中也没有创建一篇文章。(对于安全和防止垃圾广告非常强大。)它由'''From'''区设置。 ;Subject line :If <tt>[n]</tt> is present anywhere in the subject line of your email, the e-mail will be filed under the category numbered n. Otherwise, it will be posted under whichever category is selected for "Usual Category" in Step 1. Example: [1] This is a Test! would be posted as "This is a Test!", filed under General. ;主题行:如果你的电子邮件的主题栏中的任何位置上有<tt>[n]</tt>,电子邮件会归档到n号的类别上。否则的话,它就会发送到任何在第一步时为"通常的类别"选择的任何类别上。例如:[1] 这是一个测试! 会以 "这是一个测试!"发送,归档在 通常 下。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)
本页使用的模板:
模板:Rename
(
编辑
)