Highlighted

Sending PDF Form Data without Email Client

Avatar

04-11-2008

Hello,



I have made PDF Fillable Form where user can fill out the form and submit the form. I know we can create submit button and submit as PDF will attach the existing PDF Form in the default email client and when user click on send button form will email to specific defined email address.



My point is I would like to bypass the email client and assign SMTP server address so it automatically sent to defined default email recipient. Can anyone tell me how I can go this? I have number of forms that I would like to put on the web and make user comfortable to fill out and just one click sends that form to us.



Thanks,

Yash

Replies

Highlighted

Avatar

10-11-2008

I m facing the same problem, 've you got any solution ?

Thanks
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

10-11-2008

You cannot bypass the mail client ...but you could http post the PDF to a web server program and have that smtp the file where it needs to go.
Highlighted

Avatar

10-11-2008

HEllo Jalid,



I am trying to figure out via Jmail SMTP component. I will update once I figure out the solution.
Highlighted

Avatar

10-11-2008

Hi Paul,

Thanks for replaying

I m a begginner in livecycle ES

How to 'http-post' a PDF file to a web server ??
Highlighted

Avatar

10-11-2008

I am also a begginner in the livecycle ES but I am googling things and figure out the solution that's the best way to find out the ways !
Highlighted

Avatar

10-11-2008

Thanks Ypanchal for googling !

What is the difference between LiveCycle ES 8.2.1 and LiveCycle Workbench ES ? is it an upgrade of livecycle ?
Highlighted

Avatar

10-11-2008

Jalid,



You need Adobe LiveCycle Designer that designs form.
Highlighted

Avatar

10-11-2008

Here some example code of sending PDF via HTTP Submit
<br />
<br />// Begin the upload process.
<br />xfa.host.messageBox("This may take over 60 seconds.")
<br />event.target.submitForm({cURL:"http://XX.XX.XX.XX/XMLupload10.php?random="+mcode,cSubmitAs:"XML",cCharset:"utf-8"});
<br />event.target.submitForm({cURL:"http://XX.XX.XX.XX/PDFupload10.php?random="+mcode,cSubmitAs:"PDF",cCharset:"utf-8"});
<br />
<br />Here is an example PHP file that receives it on the other end:
<br />
<br /><?<br /?>
ini_set('max_execution_time', 200);
<br /> require_once("configuration.php");
<br /> $conf=new JConfig();
<br /> $con=mysql_connect($conf-&gt;host,$conf-&gt;user,$conf-&gt;password);
<br /> mysql_select_db('XXXX_XXXX',$con);
<br />
<br /> define('ADMIN_ROOT_DIR',dirname(__FILE__));
<br /> //$xml_uploaddir = ADMIN_ROOT_DIR."/XXXXXX/xml/";
<br /> //$pdf_uploaddir = ADMIN_ROOT_DIR."/XXXXXX/pdf/";
<br /> $xml_uploaddir = substr(ADMIN_ROOT_DIR,0,strrpos(ADMIN_ROOT_DIR,"/"))."/xml/";
<br /> $pdf_uploaddir = substr(ADMIN_ROOT_DIR,0,strrpos(ADMIN_ROOT_DIR,"/"))."/pdf/";
<br />
<br /> function random($length)
<br /> {
<br /> $hash =date('YmdHis',time()+8*3600)."_";
<br /> $chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz";
<br /> $max = strlen($chars) - 1;
<br /> mt_srand((double)microtime() * 1000000);
<br /> for($i = 0; $i &lt; $length; $i++)
<br /> {
<br /> $hash .= $chars[mt_rand(0, $max)];
<br /> }
<br /> return $hash;
<br /> }
<br />
<br /> $file_path = $pdf_uploaddir.random(10).".pdf";
<br /> $temp = split("/",$file_path);
<br /> $pdf_path = $temp[count($temp)-2]."/".$temp[count($temp)-1];
<br />
<br /> $body = file_get_contents("php://input");
<br /> $fp=fopen($file_path,"w");
<br /> fwrite($fp,$body);
<br /> fclose($fp);
<br />
<br /> $random_key = trim($_GET['random']);
<br /> //print_r("Random Number: ".$random_key."
<br />");
<br /> /*
<br /> $xml=simplexml_load_file($file_path);
<br /> $nodes=$xml-&gt;xpath("/form1/P1");
<br /> $xml_groupname=$nodes[0]-&gt;group_name[0];
<br /> $xml_checkin_date=$xml-&gt;DateofArrival;
<br /> $xml_contact_person=$nodes[0]-&gt;contact_name[0];
<br /> $xml_contact_email=$nodes[0]-&gt;contact_email[0];
<br />
<br /> $sql = "insert into XXX_xml_files (status,file_path,pdf_path,group_name,checkin_date,contact_person,userid,add_time,email) values (0,'$xml_path','','$xml_groupname','$xml_checkin_date','$xml_contact_person',0,now(),'$xml_contact_email')";
<br /> mysql_query($sql);
<br /> mysql_close($con);
<br /> */
<br /> $sql = "select * from XXX_xml_files where r_key='".$random_key."'";
<br /> $result = mysql_query($sql);
<br /> $count = mysql_num_rows($result);
<br /> if($count &gt; 0) {
<br /> $row = mysql_fetch_array($result);
<br /> $sql = "update jos_xml_files set pdf_path='".$pdf_path."' where xid=".$row['xid'];
<br /> mysql_query($sql);
<br /> }
<br /> else {
<br /> $sql = "insert into jos_xml_files (file_path,pdf_path,r_key) values ('','$pdf_path','$random_key')";
<br /> mysql_query($sql);
<br /> }
<br /> mysql_close($con);
<br /> $message = "
<ul class="noindent">
<li>PDF file is uploaded successfully.</li>
<li style="list-style: none">";
<br />?&gt;
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></li>
</ul>
<div id="showmsgmain">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<table width="57%" align="center" style="border:1px solid #e5e5e5">
<tr>
<td height="25" bgcolor="#E5E5E5">&#160;Information uploaded!</td>
</tr>
<tr>
<td height="122">
<br />
<div style="margin-left: 2em; color:#0066CC;">
<br /> <?php echo $message;?>
<br />
<br /></div>
<br /></td>
</tr>
</table>
<br /></div>
<br />
<br />