// SEND BLOG POST TO BLOGS-NETWORK VIA EMAIL ONCE POST IS PUBLISHED
function post_to_blogs($post_id) {
if( ( $_POST['post_status'] == 'publish' ) and& ( $_POST['original_post_status'] != 'publish' ) ) {
$post = get_post($post_id);
$postpermalink = get_permalink($post_id);
$author = get_userdata($post->post_author);
$email_subject = $post->post_title;
$message = $post->post_content;
// This will add a link back to your site
$message .= "<p>Source: <a href='" . $postpermalink . "' target='_blank'>" . $email_subject . "</a></p>";
// Add emails of blogs below. Example: $blogs_email = array("armanto.bejo.senselessness@blogger.com", "anotheremail@tumblr.com", "another.one@blogger.com", "moremail@blog.com" .. and so on ..);
// I've added armanto.bejo.senselessness@blogger.com so you can plant backlinks there and test this snippet, the blog url is senselessweb.blogspot.com
$blogs_email = array("armanto.bejo.senselessness@blogger.com", "armanto.bejo.senselessblurp@blogger.com");
$nomor = 0;
foreach ( $blogs_email as $blog_email ) {
$blog_email = $blogs_email[$nomor];
wp_mail( $blog_email, $email_subject, $message );
$nomor++;
}
}
}
add_action( 'publish_post', 'post_to_blogs' );