pdf sending via mail
-
Hi Dinamiko,
is there a way to send the generated pdf via mail as attachment? See the code from the mpdf 6.0 that you are using? The best would be to interact with formidable pro and the generated views.// mPDF 5.7.4
if (substr($path,0,7) == “mailto:”) { return; }
if (substr($path,0,3) == “../”) { //It is a Relative Link
$backtrackamount = substr_count($path,”../”);
$maxbacktrack = substr_count($basepath,”/”) – 3;
$filepath = str_replace(“../”,”,$path);
$path = $basepath;
//If it is an invalid relative link, then make it go to directory root
if ($backtrackamount > $maxbacktrack) $backtrackamount = $maxbacktrack;
//Backtrack some directories
for( $i = 0 ; $i < $backtrackamount + 1 ; $i++ ) $path = substr( $path, 0 , strrpos($path,”/”) );
$path = $path . “/” . $filepath; //Make it an absolute path
}
else if( strpos($path,”:/”) === false || strpos($path,”:/”) > 10) { //It is a Local Link
if (substr($path,0,1) == “/”) {
$tr = parse_url($basepath);
// mPDF 5.7.2
$root = ”;
if (!empty($tr[‘scheme’])) { $root .= $tr[‘scheme’].’://’; }
$root .= $tr[‘host’];
$root .= ((isset($tr[‘port’]) && $tr[‘port’]) ? (‘:’.$tr[‘port’]) : ”); // mPDF 5.7.3
$path = $root . $path;
}
else { $path = $basepath . $path; }
}
//Do nothing if it is an Absolute Link
}
- The topic ‘pdf sending via mail’ is closed to new replies.