Browse Source

Sample for creating tickets by reading a incoming emails in a mailbox

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@662 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 years ago
parent
commit
a7649afcd4
1 changed files with 5 additions and 2 deletions
  1. 5 2
      webservices/createfrommail.php

+ 5 - 2
webservices/createfrommail.php

@@ -141,7 +141,10 @@ for($index = 1; $index <= $iNbMessages; $index++)
 	$iPartIndex = 0;
 	$bFound = false;
 	$sTextBody = '';
-	if (count($oStructure->parts) == 0)
+	//echo "<pre>\n";
+	//print_r($oStructure);
+	//echo "</pre>\n";
+	if (!isset($oStructure->parts) || count($oStructure->parts) == 0)
 	{
 		$sTextBody = $oStructure->body;
 	}
@@ -178,7 +181,7 @@ for($index = 1; $index <= $iNbMessages; $index++)
 		}
 	}
 
-	$oTicket = CreateTicket($aSender['name'], $aSender['email'], $sSubject, $sBody);
+	$oTicket = CreateTicket($aSender['email'], $sSubject, $sTextBody);
 	if ($oTicket != null)
 	{
 		// Ticket created, delete the email