Home > Uncategorized > Post to your blog using email

Post to your blog using email

WordPress can be configured to use e-mail to post to a blog. To enable this functionality, you need to:
Create a dedicated e-mail account to be used solely for posting to your blog,
Configure WordPress to access that account, and
Configure WordPress to publish messages from the e-mail account

You can blog by e-mail using most standard e-mail software programs or a Weblog Client — a program specifically designed to send posts via email.

Limitations: – Standard characters in the object – Plain text only
Setting Up Post via E-mail
Step 1 – Create an e-mail account
Log in to WordPress with the administration login you use to administer your WordPress blog.
Go to Settings > Writing.
Read the instructions under Post via e-mail at the bottom of the page. At the end of these instructions, WordPress will suggest three random strings of numbers you may want to use for the login name of the new e-mail account you’ll create.
Create a new e-mail account on your web host’s mail server or a separate e-mail server, using one of the suggested numeric strings (or your own secret word) for the username (also called a “login name”). A mail server receives e-mails on your behalf and stores them for retrieval. Do not use public, free e-mail servers like Yahoo, Hotmail, etc., for this account.
Note: It is strongly recommended that you use a “secret” address – that is, an e-mail account name that is very difficult to guess and known only to you, such as those suggested by WordPress. Any e-mail sent to this address will automatically be posted to your blog. Be aware, however, that some e-mail servers do not allow numbers-only e-mail accounts or accounts starting with a number. Please check with your web host.
Step 2 – Configure WordPress to access your new account
When you are done creating the new e-mail account , return to the Writing Options panel and fill in the name of the mail server and port number your web hosting provider uses. (If you don’t know these, refer to your web hosting provider’s FAQ or manual pages. The port number is usually 110.) If your mail server requires an SSL (secure) connection, precede your mail server address with ssl://, e.g. ssl://pop.example.com.
Next, enter the login name and password for your new e-mail account .
NOTE: In the Login Name field, use the full e-mail address (e.g., user@example.com).
Choose the default category that will be assigned to posts submitted via e-mail.
Click Update Options .
NOTE: If you are using the Administration > Settings > Writing > Post via e-mail section to specify the e-mail address before you’ve actually created the e-mail account, remember to use the same login and password when you create the account as you specified in the section.
Step 3 – Publish Your E-mail Posts

You’ve created the new e-mail account and configured your WordPress blog to accept e-mails from that account, but you still need to set up WordPress to publish those e-mail messages on your blog. Do one of the following:
Manual Browser Activation

Go to the following link http://example.com/installdir/wp-mail.php immediately after you send an e-mail to your new e-mail account. (Note: You must do this every time you send a new post.)
Automated Browser Activation

An alternative to manual browser activation is to add the following iframe code to the footer of your blog:

Edit the above line of code so that it refers to the location of your wp-mail.php file. Add this line of code to the footer.php file in the directory for whatever theme you are using (don’t include it within an HTML paragraph).

You may have to refresh your blog to see the new post. New users may find this method the most helpful.

If you’re using or would like to use the Postie Plugin for WordPress, use the following iframe code, which will call Postie’s check mail commands:

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.
Action-based functions.php Activation

An alternative to calling the iframe on every page load (detailed above), or setting up a cron job (details below), you can add an action to your active theme’s functions.php file. This will check for mail every 15 minutes and does not add any HTML to your theme.
add_action(‘shutdown’, ‘retrieve_post_via_mail’);
function retrieve_post_via_mail() {
flush(); // Display the page before the mail fetching begins
if(get_transient(‘retrieve_post_via_mail’)) {
return; // The mail has been checked recently; don’t check again
} else { // The mail has not been checked in more than 15 minutes
$mail = wp_remote_get(get_bloginfo(‘wpurl’).’/wp-mail.php’);
if(!is_wp_error($mail)) { // If retrieve succeeded
set_transient(‘retrieve_post_via_mail’, 1, 60 * 15); // check again in 15 minutes.
} else {
set_transient(‘retrieve_post_via_mail’, 1, 60 * 5); // check again in 5 minutes; we don’t want to overload the server
}
}
}

This method is good for users who would like to avoid using cron jobs, which are configured on the server. Unlike cron jobs, this process will only run when pages on the blog are loaded. Cron jobs run independent of site traffic.

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s