jakebur01 Posted June 30, 2011 Share Posted June 30, 2011 I am following this code here http://www.mach5.com/products/popmonger/manual30/scripts.html to retrieve sections of the returned e-mail. However, this class does not look right. class object Popmonger string HeaderText; string BodyText; string MessageText; string FailedAddress; string HeaderField($sHeader_name); string Field($iFieldNumber); int FieldsCount; string MIMEPart($iPartNumber); int MIMEPartsCount; void RedirectMessage("sTo_address1,To_address2,To_address3"); void ReplyWithText($fsFom_address, $sSubject, $sReply_text); void SendMail($from_address,$sTo_address,$sSubject_text,$sBody_text,$sEx_headers); void SaveToFile($sFile_name, $sText_to_save, $bIsAppend); I want to retrieve the string BodyText; or string MessageText; and run something like this: $pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i'; preg_match($pattern, $bodytext, $matches); $fax = trim($matches[0]); Quote Link to comment https://forums.phpfreaks.com/topic/240796-jacked-up-class/ Share on other sites More sharing options...
jakebur01 Posted June 30, 2011 Author Share Posted June 30, 2011 This is what I am really looking to do. Retrieve the fax number from the e-mail and write it to a text file. I am just not sure about the class and how it should be formatted. <?php class object Popmonger string HeaderText; string BodyText; string MessageText; string FailedAddress; string HeaderField($sHeader_name); string Field($iFieldNumber); int FieldsCount; string MIMEPart($iPartNumber); int MIMEPartsCount; void RedirectMessage("sTo_address1,To_address2,To_address3"); void ReplyWithText($fsFom_address, $sSubject, $sReply_text); void SendMail($from_address,$sTo_address,$sSubject_text,$sBody_text,$sEx_headers); void SaveToFile($sFile_name, $sText_to_save, $bIsAppend); $pattern = '~fax\s+#\s+:\s+\K(??!from).)+~i'; preg_match($pattern, $bodytext, $matches); $faxnumber = trim($matches[0]); $myFile = "vsifax_failures.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = "$faxnumber\n"; fwrite($fh, $stringData); fclose($fh); ?> Quote Link to comment https://forums.phpfreaks.com/topic/240796-jacked-up-class/#findComment-1236800 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.