How to post by email
This man page refers to b2evolution version: 0.8.6
You can post news from an email client!
But first you'll have to edit /conf/_advanced.php, filling the appropriate values for your POP3 email account (this interface doesn't support IMAP yet, only POP3, sorry).
Once you have edited the config options, you can make your webserver execute /htsrv/getmail.php every set amount of time (depending on your host's performance, this script can be resource intensive, so don't make it run every minute or you'll be kicked).
You can do it with Cron-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your b2mail.php URL.
Preliminary advice
It is strongly advised to send your email as text-only (Outlook and Outlook Express default to 'html', which may cause problems), but HTML email could work (the script would strip all your html tags though...).
It is also advised not to use your public email address, but create a new one especially for this script. If you use your public email address and the script goes crazy posting every email on your blog and deleting all your emails, I can't take responsibility for this.
Make sure you delete any email sent to your blog in your 'Sent' folder too, just in case (you don't want someone to find your login and password in the 'Sent' folder).
The script will delete the emails that were used to post stuff on your weblog if it successfully posted your stuff. If it didn't manage to post, the email is not deleted.
How to post
Now to post something, here's how your email should look like:
To: address@domain.com (you set it in the config file)
Subject: blog:the post's title (you can change 'blog:' in the config file)
Body:
login:password (example: Jack:Starwars)
The content of the post, blah blah blah.
More blah blah.
___Subject must start with [blog:], or any string you set in the config file (so that the script doesn't check EVERY email in your mailbox).
Body's first line must always be login:password, else the script will just skip the email.
If you don't use [___] (or any body terminator that you set in the config file), the script will post the whole body, which is not what you want if you send email with Yahoo or Hotmail (you don't want their ads on your blog, do you?).
Special cases for mobile phone email
Some mobile phone service providers may allow you to send email with your mobile phone or PDA, but on such devices you can't always include line breaks. In such case, you have to set $use_phoneemail = 1 in /conf/_advanced.php, and then here's how you write the email:
To: address@domain.com
Subject: blog:the post's title :::
Body:
login:password ::: The content of the post, blah blah blah.___You will have to append ':::' (or whatever string you set in the config file) after the subject, and after the login:password.
Some mobile phone service providers may not allow you to set a subject, and they'll make the subject be the first characters of the body, in which case you would send an email like this:
To: address@domain.com
Body:
blog:the post's title ::: login:password ::: The content of the post, blah blah blah.___26 comments
the b2mail.php cannot read attachements, right? This would be just great. I'm using easyMoblog at the moment, which supports email-attachments, works but it is very basic. If you implement this some day, let me know!
Btw. - great work!
Cheers,
Jens
I've changed (in _advanced.php) the default_to_blog setting to point to blog 5, but it doesn't seem to change anything.
Thanks,
Mark
b2evo User Manual
Manual :: How to... ::
Page: How to post by email English (EU)
Cette page se réfère à la version 0.8.6 de B2evouliton
Vous pouvez mettre à jour votre site par email !
En premier, éditer le fichier /conf/_advanced.php, et renseigner les informations concernant votre compte émail (attention cette interface ne supporte par les imap pour l'instant, utiliser uniquement POP3).
Une fois que vous aurez éditer ces option, il faut que votre server exécute /htsrv/getmail.php à intervalle régulier. (le temps de rafraîchissement dépend des performances de votre serveur, le script peut utiliser beaucoup de ressources, donc ne le faites pas tourner toutes les minutes !).
Vous pouvez le faire aussi avec un cron, où si votre hébergeur ne support pas cette fonction, vous pouvez vous intéresser aux services de monitoring de site, et faire en sorte qu'ils checkent l'url du fichier b2mail.php
Premier conseil.
Il est recommandé de rédiger ses émail au format texte seulement (faites attention car Outlook et Outlook express utilisent par défaut les fonction "html", ce qui peut poser des problèmes), mais les émails au format html fonctionnent tout de même. Généralement.
Il est aussi recommander de ne pas utiliser une adresse publique, mais d'en créer une spécialement pour ce script. Un script peut toujours bugger. Et pourrait effacer tout vos mail. Nous ne pouvons prendre de responsabilité à ce sujet.
Assurez vous d'effacer tout les émails envoyé à votre blog contenu dans le dossier "envoyé" (sent) juste au cas où (pour éviter que quelqu'un ne trouve votre login et mot de passe dans ce dossier).
Le script effacera les émail que sont utilisés pour poster une info dans votre blog dès que votre émail sera publié. Si la publication a échoué l'émail ne sera pas effacé.
Comment poster un émail sur votre site.
L'émail devra être rédigé ainsi :
To: addresse@domain.com (vous aurez configuré cette adresse dans le fichier de configuration)
Subject: blog:Le titre de l'article (vous pouvez changer le mot clef 'blog:' dans le fichier de configuration)
Body:
login:password (exemple: Jack:Starwars)
Et votre texte, blah blah blah.
More blah blah.
___
L'objet doit commencer avec l'expression [blog:], ou n'importe quoi quel autre mot que vous aurez configurer dans e fichier de configuration (comme cela le script ne checkera pas tout vos mails).
Boby (corps du texte). La première ligne DOIT contenir le login et le mot de passe sous cette forme login:password, sinon le script ne prendra pas en compte le mail.
Terminer votre émail de 3 tirets bas ___
afin de prévenir le script de la fin de votre texte et d'éviter ainsi de publier les publicités qui accompagnent souvent les mails (yahoo, hotmail…).
Le cas spécial des mails envoyé par téléphones portables !
Certaines sociétés de téléphones portable permettent d'envoyer des mails. Mais sur ces services, vous ne pouvez pas toujours contrôler le renvoi à la ligne. Dans ce cas, paramètrez ainsi la ligne $use_phoneemail = 1 du fichier /conf/_advanced.php. Dans ce cas, utilisez la syntaxe suivant pour envoyer vos mail ;
To: adresse@domain.com
Subject: blog:le titre de votre article :::
Body:
login:password ::: Le contenu de votre mail blah blah blah.___
Attention aux ':::' (or ou tout autre signe porte dans le fichier de configuration) arès le sujet et le login:password.
Certains fournisseurs de téléphones portables ne permettent pas d'utiliser la case 'objet'. Ce sont les premiers caractères des mails qui sont utilisés pour l'objet. Dans ce cas rédiger votre mail ainsi :
To: adresse@domain.com
Body:
blog:le titre de l'article ::: login:password ::: le contenu du message, blah blah blah.___
With Mozilla, everithing is OK, but with IE 6.0, I don't post. Why???
16
Use the ID # of the category - you can figure this out by clicking the "Categories" tab in the admin, then click the blog you want to post to. Mouse over one of the categories and look in the status bar of your browser - you should see some code that looks like:
http://blogs.mysite.com/admin/b2categories.php?action=Edit&cat_ID=16
The category ID is the "cat_ID" in the query string.
There may be (and probably *should*) be an easier way to do this.
\16\
-Scott
Is there a line of code to enter into the body of the email that will do this?
I want to use a blog to receive emails but not give the option for readers to comment.
Thanks for any insights . . .
Warning: strpos(): Empty delimiter. in /var/www/http/www.domain.tld/blog/htsrv/getmail.php on line 248
The post makes it into the blog but the mail does not get deleted. Maybe because of this error notice or maybe because of another bug.
The next time getmail.php runs it does the same work on the old mail again and it appears again in the blog.
Maybe somebody can help me out with that... :-)
Login: username, Pass: password
(changed from real user ID password)
Wrong login or password.
OK.
How to I fix this problem
--------
Login:
, Pass:
Wrong login or password.
OK.
-------
I can't figure out where I am missing the login name and password.
It is both in my email body as the first line "loginname:password" and it is in the advanced.php file.
Any suggestions?
Dave
I'm using the post by email feature, too. I know you can change category by writing something like "15" (without qoutes and 15 being the category id), but I also need to change the message status from published to protected. I tried "protected", but getmail.php said "Illegal tag: status". So is it possible to change the message status by posting through posting by email? I hope you know what I mean...
Thanks for answering,
GT-Schorsch
the category-tags and the wrong status-tags I used in the above message are not properly shown. I just wanted to say that for better understanding.
Bye,
GT-Schorsch
I tried to schedule getmail.php in cron, but when I run it from command line, it prints out the html that looks like the login page, and exit, no getmail logic seems to be executed. How to set it up then?
I am using 1.6alpha
Jun
// INSERT NEW POST INTO DB:
and change "published" to whatever you want. I suppose you could create a variable to designate this in the content of the e-mail also.
As for me, I just want to send a draft to the blog in order to post it later.
Now the postings are visible in backoffice. But I cannot get them to the blog. Any help will be highly appreciated.
/Ish
This is sent in the first line of the e-mail with the format...
login:password
the colon between each is necessary.
the email function...
Requested Blog from T_blogs without ID!
Any suggestions?
Thank you!