You are here: Developer Forums » General Questions » Still not clear to me

Still not clear to me

Bruce (1)
Oct 10/08 08:19
I guess I'm really missing how to set this up. I am using the account you set up - but how and where do I tell email2http to send the POST output to one of my php programs? Could be very usable but I would like to see some clear instructions (with maybe a couple of simple examples).
TT (6)
Oct 10/08 17:00

Edited:
Oct 10/08 17:01
Hi Bruce,

If you sign in to your account, you will see that you have one domain with a name like bruce.sample.email2http.com. Click on that domain name, and it will bring up a screen that shows the "Target URLs" for the domain. A target URL is the URL that Email2HTTP posts your mail to.

In the sample domain (like bruce.sample.email2http.com), there will be a sample target configured (http://www.email2http.com/demo/1). To instead post to your own script on your server, you need to change that target. Click the target title, "A sample target that you can delete", and then modify the URL to point to a script on your own server, like http://www.example.com/my-php-script.php. Click Save.

From that point on, email sent to anything@bruce.sample.email2http.com (or whatever your domain is) will be posted to your PHP script at http://www.example.com/my-php-script.php. />
In your script, you will have access to fields like $_POST["subject"] that you can use to handle the mail. To get started, try writing a simple script like this:

<?php
$fp = fopen("my_file.txt", "w");
fputs($fp, print_r($_POST, true));
fclose($fp);
echo "Thanks!";
?>

That will dump the contents of every email you receive into my_file.txt, and send an autoresponse back to the sender that says "Thanks!".

To see a complete list of $_POST fields available to your script, see
https://email2http.com/help/read/15 />

Hope this helps. I'll also reply to your email with this information. Let me know if I can be of further assistance.
Shannon Prue (1)
Nov 10/08 12:16
in order to quickly start (avoiding reading all the documentation)
I wrote a small script to help me utilize the data posted to my app.

<?php
echo '<pre>';
print_r($_POST);
echo '</pre>';
?>

What this does is return an email with all the posted values with their associated names, once you know all the values posted, you will be able to modify your php script to handle them.

This is an extremely simple implementation,

Planed usage: Autoresponder Email Functions / Helpdesk CRM Email Routing / tracking
Posts 1 - 3 of 3
Copyright © 2006-2009 Trevose Consultants Ltd.
Contact us | Terms of Use