Orang IT Indonesia » hacks http://www.orangit.com A Blog Written By Ahlul Faradish Resha, S.Si Mon, 06 Feb 2012 17:30:23 +0000 en hourly 1 http://wordpress.org/?v=3.3.1 WP-Hacks: Fetch Post Via Email and put in any category http://www.orangit.com/2010/01/24/wp-hacks-fetch-post-via-email-and-put-in-any-category.html http://www.orangit.com/2010/01/24/wp-hacks-fetch-post-via-email-and-put-in-any-category.html#comments Sun, 24 Jan 2010 11:58:29 +0000 Ahlul http://ahlul.web.id/blog/?p=698 Continue reading ]]> [postnotice]

Sometime you would like to send the post via email because it easier and simply.

For long time ago, wordpress has support this function. But almost of wordpress user didn’t know about that.

Ok before make some hacks ;) please follow this instruction if you don’t know about post via email settings.

  1. Go to Settings >Writing ([domain]/wp-admin/options-writing.php)
  2. Please see at “Post Via E-Mail” section.
  3. Enter all information needed, such as: your mail server, mail username, password.
    FYI: for google account you can use mail server: ssl://pop.gmail.com, and port 995.
  4. After all mail settings is filled, you can select default category for the fetched post.

Ok, let do some test ;)

Send and email to the email account that you set in post via email settings.

After your mail is sent, please access wp-mail.php. You can find it at: [domain]/wp-mail.php.
If success, you should see some fetching process.

Now, look at your posts :) if success it must saved and listed. But for first post from that mail you have to approve it manually.

NOW LET MAKE SOME HACKS ;)

When you post is successful fetched, the post category is match with default category that you set before.

I think at your mind there is a question: how make the category as you need?

Let’s I answer that question:

Go to your file manager of your hosting, and edit file wp-mail.php (you can find it at main directory of wordpress installation).
If you not have file manager you can use FTP for download and edit that file.

Find the below line:

$post_category = array(get_option('default_email_category'));

And, change it to:

$arr_pt = explode(":",$post_title);
$cat_ID = get_cat_ID($arr_pt[0]);
if($cat_ID) {
$post_category = $cat_ID;
$post_title = $arr_pt[1];
} else {
$post_category = array(get_option('default_email_category'));
}

Yap done ;)

HOW IT WORKS?

Technically, Mail Subject will be as Post Title for fetched post.

Now with this hack, you can use this format for mail subject:

Category Name:This dummy title for fetched post via email

Please see “:” between category name and post title. It use as separator for this case.

Now you can try it ;)

And for last to do, don’t forget to set a cronjob for automation mail fetch.

In many case you can use this command:

GET http://yourdomain.com/wp-mail.php

If you use Windows Hosting I think you can use other wordpress plugin that support for emulate a cronjob.

NEED SUPPORT?

He2, if you still have the problem or found it not works for you, please don’t hesitate to contact me at ceo.ahlul[at]yahoo.com

————–

Now you can post anywhere from your phone (with send mail support) ;)

]]>
http://www.orangit.com/2010/01/24/wp-hacks-fetch-post-via-email-and-put-in-any-category.html/feed 5