We need to follow the following steps to post via email from WordPress blog:
- I was using a gmail account. The domain was also managed by google but this shouldn’t matter even if it’s a regular gmail account. Need to make sure that POP/IMAP access is enabled. This is done in settings page.
- Make sure this is a fresh new email setup exclusively for this purpose. Don’t use your regular daily email account because every mail in inbox will get picked up for posting
- Need to make sure that the the access to less secure app is turned on. Its available here: https://www.google.com/settings/security/lesssecureapps. This will not work if the email account is setup for 2-step verification
- I installed a plugin called Postie on the wordpress blog and configured this plugin for post via email on its settings page.
- On this settings page, Mailserver tab, I entered the new email account along with other settings like IMAP server name, port and login credentials
- Also on the settings page, in message tab, i set changed two settings: Filter newlines = Yes and Replace newline characters with html line breaks (<br />) = Yes. This allows the line breaks to be preserved the way they are in the original email.
- I was using cpanel on my web hosting server. I had to setup a cron job. This was setup using the following command: wget –user=[username] –password='[password]’ http://%5Bmysite%5D/?postie=get-mail. I have set up username/password to access this site so i had to pass this in my wget command. I set this to work once per hour.