Jump to content

Recommended Posts

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]);

 

 

Link to comment
https://forums.phpfreaks.com/topic/240796-jacked-up-class/
Share on other sites

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);
?>

 

Link to comment
https://forums.phpfreaks.com/topic/240796-jacked-up-class/#findComment-1236800
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.