In this example, we want to parse all emails at address@email.sendgrid.biz and post the parsed email to http://sendgrid.com/email.php.

Given this scenario, the following are the parameters you would set at the Parse API settings page:

1
Hostname: email.sendgrid.biz
1
URL: http://sendgrid.com/email.php
To test this scenario, we sent an email to isaac@email.sendgrid.biz and created the following form at http://sendgrid.com/email.php:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
$to = $_POST["to"];
$from = $_POST["from"];
$body = $_POST["text"];
$subject = $_POST["subject"];
$num_attachments = $_POST["attachments"];

if($num_attachments){
   $uploadName = "attachment1";
   for($x =0; $x<$num_attachments; $x++) {
      move_uploaded_file ($_FILES[$uploadName] ['tmp_name'],"./uploads/{$_FILES[$uploadName] ['name']}");
      $uploadName++;
   }
}
?>