-
Website
http://blade.lansmash.com/ -
Original page
http://blade.lansmash.com/2004/06/16/wp-mailphp/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
smith mountain lake
1 comment · 1 points
-
Loan Modification leads
1 comment · 1 points
-
maietta
1 comment · 1 points
-
kuru
2 comments · 1 points
-
dodly
1 comment · 1 points
-
-
Popular Threads
:(
worked.
one snag, i didnt have pear installed, and I am on a shared host, so I went to pear, and got pear.php and just dropped it in the wordpress directory.
i was impressed how multiple images came out inline, sent using Mac OSX 10.3 Mail.
The other snag, was that I might be sending from various emails (like from phone, etc), so at first my email got rejected. I had to setup the different users in WP. Can it be optional to set the account it is supposed to post under?
And one more thing... I would like to use this for moblogging. Is it possible for thumbnails be created of the images, with a link to the original image (like this hack http://tellitinlove.com/archives/2004/05/31/wp_...)
Keep up the great work!
my phone sends email with "< " and ">" around the email, so the sender is rejected.
it looks like "<email>".
also, although apple's mail sent the email fine with multiple inline images, when sending with mozilla mail, it inserts all the html into the blog. this should be removed?</email>
{
$from = $matches[2];
}
which should solve your problem.
if (preg_match('/^[^
]+([< "])([^]+)\2$/',$from,$matches)){
$from = $matches[2];
}
< />< />
i meant to write the less than and greater than sign... angle brackets. < and >
< and >< />A few caveats and suggestions: I agree that it would be very nice to allow some addresses that are not in the user database to post so that I could allow my phone to email the script. Thumbnails would be nice, too. You should mention that PEAR is required - it wasn't a problem, but added a step I wasn't expecting.
It didn't seem to fix all of the linebreaks in my message. This is an issue with these mail-based posting scripts when used with the WP formatting functions.
It would be very cool if you could use the name of the category rather than the number to choose a category in which to post.
In all, it's a very effective method of getting files posted via email. Good job!
I have updated the wp-mail.zip to include PEAR.php. Try and re-download the zip file again and have a go!
TIA -
Matt
//global $photosdir;
$photosdir = 'wp-photos/';
$filesdir = 'wp-filez/';
Should I change this to be an absolute path?
Server:/etc matt$ wget http://192.168.0.25/wordpress/wp-mail.php
--13:15:03-- http://192.168.0.25/wordpress/wp-mail.php
=> `wp-mail.php'
Connecting to 192.168.0.25:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
wp-mail.php: Permission denied
Cannot write to `wp-mail.php' (Permission denied).
Any idea what I need to change to automate this process?
Regards -
Matt
1) When using WGET from the command-line to call the page, the posts are grabbed but the mail is not deleted from the account. So the next time wp-mail is called, the same posts are added again.
2) The time seems to be off by a few hours so the posts are added in the past.
Any ideas?
Regards -
Matt
***************
Database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE user_email='christine@colormepink.com'' at line 1]
SELECT id FROM WHERE user_email='christine@colormepink.com'
invalid sender: christine@colormepink.com
***************
If someone could shed some light on what the heck I'm doing wrong I would be unendingly grateful. Thank you.
Anyone know of a way to resize those images on the fly? I want them to fit in with the rest of the images on my site (350px wide)
My phone attaches a long footer to the end of the pic-message. Gotta love Verizon. Is there a way to have wp-mail stop parsing the message when it hits an indicator within the message? That way I could include something like ### to the body of my message and it would not process the attached footer.
I second the option to remove text footers from emails sent (a la T-mobile) or delete all text after (and including) a certain string value ("--" or "##" etc).
I'd send you a paypal donation, dude. Seriously.
$post_date = date('Y-m-d H:i:s', time($ddate) + ($time_difference * 3600));to say$post_date = gmdate('Y-m-d H:i:s', time($ddate) + ($time_difference * 3600));and it should be fine. :)Second, I am getting a peculiar error with the categories. My email was processed, but when I went to the front page of my blog, I got the following error where the category should be:
'Category:
Warning: Invalid argument supplied for foreach() in /home/geodog/public_html/strangelove/
wp-includes/template-functions-category.php on line 65'
When I went to the editing page to correct it, I found the following error under the categories column:
'Warning: in_array(): Wrong datatype for second argument in /home/geodog/public_html/strangelove/
wp-admin/admin-functions.php on line 41'
This is probably not a problem specific to your hack, as I am having it with the regular wp-mail.php as well, but I was hoping that you might be able to shed some light on it.
As my contribution back, here is some code which should answer the request above about deleting footers:
Insert this at the appropriate place:
# variable for string after which we don't want file. Obviously
# must be unique. I am using dashes as an example.
$stop_here = "---------"
# find it using strpos
$pos = strpos($content, $stop_here);
# subtract unwanted content
$content = substr($content, 0, $pos);
Thanks in advance for any help you can provide.
Tim
$subject = eregi("(.*)=\?iso-2022-jp\?B\?([^\?]+)\?=(.*)",$subject,$regs);
$subject = $regs[1].base64_decode($regs[2]).$regs[3];
$subject = htmlspecialchars(mb_convert_encoding($subject, "EUC-JP", "auto"));
and also
$content = mb_convert_encoding($content, "EUC-JP", "auto");
so that I can have e-mail in Japanese EUC_JP shown correctly?
[category_id]Subject Test
[2]Weirdos From Space
If brave, try to achieve "[Travel]Visiting Canada" via the following.
$sql = "
SELECT *
FROM $tablepost2cat
WHERE post_id = $post_ID
AND ( category_id = $post_category
OR cat_name = '$post_category' )
";
$exists = $wpdb->get_row($sql);
Thanks for the efforts John,
Michael
http://peimic.com/wp/wp-mail.php.txt
Cheers,
Michael
Happens with the regular Wordpress wp-mail, too, and there's a bug report in --so maybe it will be fixed.
I believe the code:
$post_category = ( !is_null($id) ) ? $id : $post_categories[0];
should be:
$post_category = ( !is_null($id) ) ? $id : get_settings('default_category');
Maybe I am missing something?
I've been able to post, but the images aren't showing up. I created the wp-photos and wp-filez dirs and chmod 777 them, but nothing appears in them. I get the "Mission complete, message 1 deleted" and see that the image is in the wp-mail.php page. At the bottom the "Posted content:" is blank. Ideas?
This script mod rocks.
I have found a bug however. My mobile uses a from address of "<mobile>" which your script can't successfully extract and so does a lookup in the DB for the address including the </mobile><mobile> which obviously doesn't work.
I fixed it by adding the following line at line 72:
$from = ereg_replace("((\< )|(\>))", "", $from);
There may be a better way of doing it, but this works. I haven't done extensive testing but it doesn't seem to break anything.
Cheers again for the good work!</mobile>
I'll e-mail it to you :-)
I amended thus:
$count = $pop3->login(get_settings('mailserver_login'), get_settings('mailserver_pass'));
if (0 == $count) {
$pop3->quit();
die(__('There does not seem to be any new mail.'));
}
which seemed to fix it.
might help someone, wondering why it works once and once only.
;)
Just one small problem to report: When posting something with Swedish characters (or any other non-US characters I suppost) in the SUBJECT, they don't get translated correctly. MIME converts these to Quoted-Printable, but wp-email.php does not seem to convert them back.
Maybe someone can fix this easily (my blog is in Swedish)?
In wp-mail.php after the line:
"$subject = trim($structure->headers['subject']);"
place this line:
$subject = htmlentities($subject);
And does it work with "non-US characters" ?
Great hack.
Posts are not getting deleted by this script! Is there something I need to change somewhere? Please help! It's really annoying!
Maybe I wasn´t precise enough. I don´t think that there is something wrong with mimedecode. Apparently it works for many people. But definitely there is a problem with the interaction of the WP-Mail-Hack and i.e. the SE T610 cell phone.
I cannot change the way my cell phone is sending emails but there could be a chance to get it working by modifying the WP-Hack. That is why I was thinking about mimedecode.
I changed: fwrite($fp, $part->body);
to: fwrite($fp, base64_decode($part->body));
and it works for me now.
(Using a Treo 600, btw.)
I found it support the title, not the content of the UTF-8 coded email. Could you give me some suggestion?
This is a great plugin, but looking at the code, I must warn you there's is a huge security issue with it.
You should not be letting people upload random type of files. And you should definitely not let people upload, for example, PHP files within the web root.
Imagine the potentially devastating consequences if somebody get ahold of whatever mail address a blog author uses: he can easily send an email forging the From address and upload a malignant php file that could wreak all sorts of havoc on the server.
At the very least, it should limit uploadable files to zip, gz and other compressed formats and maybe accept other formats after compressing them automatically. That way there won't be any easy way to run executables on the server (it would still be a good idea to impose a strict control on what can be uploaded and how big it can be, imho).
I hope this will be of some help to you and do not hesitate to email me if you want to discuss this. Do not hesitate to hide this comment if you feel you'd rather not have it shown to visitors.
cheers,
Warning: Invalid argument supplied for foreach() in C:\Domains\gastonl.com\wwwroot\moblog\wp-includes\template-functions-category.php on line 65
Have someone solved this?
I saw at least 4 posts about this, but with no fix.
Any help?
http://blade.lansmash.com/index.php?p=93
Would love to hear what other people think of my updated mod!
I had the problem where the email was getting posted, but not deleted from the server. I traced it to the pop3 quit command not getting properly processed.
I added this to replace the pop3->quit();
----------------------------------
$status = $pop3->quit();
print 'Quit status = ' . $status . "
";
if ( $status ) {
print "Quitting...
";
} else {
print '
Oops '.$pop3->ERROR.'
';}
print "Done.
";
-------------------------------------
Sometimes, it didn't print anything, so I lowered the timeout value in wp-includes/class-pop3.php from 60 seconds to 10. It seems to work reliably now.
www.poker-w.com
www.texas-holdem-big.com
www.poker-w.com
www.texas-holdem-big.com
--------------------------------------------------
Website Hosting Packages - Windows 2003 Server
Web design hosting site
http://www.efextra.net</hr>
texas holdem here :) right free
online texas holdem here. But right away here
http://www.texas-holdem-p.com you can find the right info for play texas holdem
now.
online poker here :) right free
online poker here. But right away here
http://www.online-poker-888.us you can find the right info for play online poker
now.
recommen this website online poker . Please refer to our
friends and play online poker also free
online poker http://www.online-poker-888.us to our best greetings.
But other than that, ace!
Free Newsletter Template
Emin Template
Web Template Plumbing
Free Microsoft Word Template
Business Templates
Web Templates Quality
Free Fake Id Templates
Commercial Templates
Template Driven
Free Frontpage Template
Clothing Design Templates
Template Web Design
Free Pet Web Templates
Download Fake Id Templates
Website Specification Templates
...
...
...
...
respect
Milli
______________________________________________
regards
Hestin
______________________________________________