| View previous topic :: View next topic |
| Author |
Message |
bobhinkle
Joined: 13 Oct 2006 Posts: 68
|
Posted: Thu Mar 01, 2007 1:39 am Post subject: Process by email |
|
|
| I know you offer this threw your site but wanted to see if you would tell us how you allow people to post pics threw email if their phone can't change the mmsc server. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Thu Mar 01, 2007 9:51 am Post subject: |
|
|
You have to get your webhost to forward the catch all email account to a script.
We could only get our webhost to forward the catch all acount to a .sh script (a shell script). So I then just put one line in the shell script pointing it to my send.php.
And in my send.php script, I have the code that php needs to open and read an email:
| Code: |
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd); |
Then I simply decode that $email variable and take out all the parts. One of the parts I check first is the "To" field - since it is the catchall account, it contains spam and everything else. So I make sure that the email is sent to the correct username.password or I just delete it.
And the script I use to decode that $email variable is not mine - just like the mmsdecoder.php script is not mine. I'm using one of the available mime decoder scripts out there. The one I'm using is called mimedecode.php, and is rather popular and well documented if you want to use it and need help.
BTW, I do not have this set up on humpa.com. I have it set up on www.thephonecam.com |
|
| Back to top |
|
 |
bobhinkle
Joined: 13 Oct 2006 Posts: 68
|
Posted: Tue Mar 13, 2007 8:01 am Post subject: |
|
|
| was your system setup on plesk 8? Just trying to see if you used the mail box options to just forward the email to the script or did you have to do piping. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Tue Mar 13, 2007 8:51 am Post subject: |
|
|
| bobhinkle wrote: |
| was your system setup on plesk 8? Just trying to see if you used the mail box options to just forward the email to the script or did you have to do piping. |
I don't know.
We asked the webhost if they could forward the cathchall to a script. They said they could forward it to a .sh script - and that's about it.
EDIT: hmmmm ... I see that I already said that.
Were you asking something else? |
|
| Back to top |
|
 |
bobhinkle
Joined: 13 Oct 2006 Posts: 68
|
Posted: Thu Mar 15, 2007 4:35 pm Post subject: |
|
|
| No i was just trying to see how you did it. Thought maybe you setup the server for the catchall. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Thu Mar 15, 2007 9:30 pm Post subject: |
|
|
| bobhinkle wrote: |
| No i was just trying to see how you did it. Thought maybe you setup the server for the catchall. |
Exactly. The catchall goes to my custome MMS script. My script then just deletes anything that isn't addressed to a valide username.password |
|
| Back to top |
|
 |
bobhinkle
Joined: 13 Oct 2006 Posts: 68
|
Posted: Tue Mar 20, 2007 11:21 pm Post subject: |
|
|
| any chance i can get just the basic php script. I don't need it to check users yet. Just to be able to except an email as its input and process the information i guess. Or is it just a basic script. |
|
| Back to top |
|
 |
Humpa Site Admin

Joined: 06 Nov 2005 Posts: 10258
|
Posted: Wed Mar 21, 2007 1:25 am Post subject: |
|
|
I just use something already written.
It is called mimedecode. I don't have the link handy, but it will be what you find if you search google for "php mimedecode".
But what would probably be far easier for you is to set up WordPress blog with the postie plugin. You don't have to use the blog itself. Just get it all setup and figure out how to get it to save the pic where you want it, then work with that. There is a rather detailed post in my forums from Phree who has already done just that.
www.humpa.com/forums/ptopic64.html
No need to reinvent the wheel, you know?
WordPress with the postie plugin is already made and ready to use. Plus it is extremely well documented. It would take me hours to get a script rewritten for you to use. And then countless hours more helping you customize it so it would actually work. |
|
| Back to top |
|
 |
Phree

Joined: 31 Dec 2005 Posts: 254 Location: South Coast, UK
|
Posted: Wed Mar 21, 2007 8:58 am Post subject: |
|
|
| If you need any help setting up wordpress and postie, let me know...It took me a fair while to set it up (with Humpa's help) and I'm happy to help if you need any. |
|
| Back to top |
|
 |
bobhinkle
Joined: 13 Oct 2006 Posts: 68
|
Posted: Fri Mar 23, 2007 10:02 am Post subject: |
|
|
| Thanks for the offer, i will do what i can before i start bugging you guys too much. |
|
| Back to top |
|
 |
|