Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-29-2007, 07:09 PM   #1
Registered: Aug 2005
Distribution: Ubuntu 14.04
Posts: 72

Rep: Reputation: 15
Can I make a script to post emails to a forum? [nvm]

Hi guys, I've got a question and I figured that the people here are most likely to have an answer to this question.

I'm admin of a website for our high school's robotics club, and we've been trying to redesign our site for next year's competition because the site is part of the ranking. One thing I was working on adding was a properly updated RSS feed, because our president isn't going to update the RSS feed by hand when she posts a new message to the (google groups) mailing list.

Now, using Simple Machines Forum's SSI (server side includes) I made a php script that generates an RSS feed from the topics in a certain board (I think they had a tutorial on how to do it so it wasn't hard). However, the president never posts announcements on the forums in the announcements board that I set up for that purpose. I don't blame her because no one really checks the forum anyway.

I was wondering if it is possible to write a script on the server (perhaps set up to run as a cron job) that checks the email of a certain account which only gets email from the mailing list, and then posts a message to the forum in the appropriate board. I think the main difficulty for me would be checking the email account, as I don't know if you can do this in php. I'm willing to learn perl or whatever it takes if I have to. The site is hosted on bluehost. Thanks for the help!

Edit: A quick google search turns up php IMAP functions as a way to check email through PHP, although I am not certain whether my host has that enabled. In the cpanel there is an option for installing PHP PEAR packages, might this allow me to install IMAP support if it doesn't already exist?

Edit again: I found that there is a package available for installation on my server. Probably will be able to figure out how to use it to do what I want, but if anyone has any experience with this then feel free to chime in.

Last edited by i.of.the.storm; 12-30-2007 at 12:51 PM. Reason: resolved
Old 12-30-2007, 08:55 AM   #2
Senior Member
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 4,956

Rep: Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875Reputation: 875
I am not very fond of this complicated constructs in PHP. What I usually do is to write some Bash script which uses simple and proven tools to carry out a task.

You say you are not sure about IMAP. Well, then use a Bash tool to check for mail using the POP protocol (fetchmail, procmail, telnet). Lat Bash do whatever you need to do and test it in Bash. Once everything works, use the exec call from PHP.

Just make sure that everything you write or access can be accessed from PHP which uses most likely the www-data credentials.

Old 12-30-2007, 12:49 PM   #3
Registered: Aug 2005
Distribution: Ubuntu 14.04
Posts: 72

Original Poster
Rep: Reputation: 15
Hmm, thanks for the ideas. I've decided on a simpler, less automated method because now I'm not sure whether you can post from a script. I'll just add a dummy email account to the mailing list that always auto-replies "Make sure you post the news in the forum as well." Simple, and effective. Thanks for the help anyway.


email, forum, list, machines, mailing, simple

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VectorLinux user, must make post before I can post url The Headacher Member Intro 2 07-02-2011 11:55 AM
First post on this forum 300zxkyle Member Intro 1 06-22-2007 03:51 PM
Post in more than one forum? lefty.crupps LQ Suggestions & Feedback 9 12-14-2006 03:17 AM
A strange forum post The Bad Penny General 8 01-28-2005 10:27 AM
can't post on a forum? pablowablo General 3 08-15-2004 03:29 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration