Send PDF form to e-mail as attachment with a PHP script on the server
Hi,
For several days I've been searching though the internet looking for a solution, a quite simple one in my opinion, but I got a little desperate not getting any result I want.
Okay. The Situation.
I have a PDF form to order sandwiches and drinks.
The PDF has serveral area's and columns where customers fill in the amount of the products they would like to order.
At a position of a field, the kitchen can almost blindly see what products a customer ordered.
Therefore, when someone fills in the form, I want to send the filled PDF by e-mail to the kitchen's e-mail adress. And important: the PDF in the kitchen's mailbox should be completely identical to the form the customer filled in.
So, I have an Order button in my form. I set the action as 'Submit a form'.
In the settings under 'Enter a URL for this link' I used just some PHP mailer script I also use on my website contact form.
IF I check 'HTML' under 'Export Format' the PHP mailer works fine. I receive an HTML e-mail listed the ordered products.
BUT
I do want the original filled PDF in my mailbox instead of an HTML e-mail.
So, for 'Export Format' I checked 'PDF The Complete Document'.
But then my PHP mailer script doesn't work anymore.
It gives errors like 'no valid e-mail adres' , etcetera etcetera.
Who has a solution?
Who has a working standard PHP script for me what just sends the kitchen an empty mail with the original PDF as attachment?!
There is no need to use any database or other more complex functionality. Just mail the filled PDF.
You can submit whole PDF format as long as you enable usage rights on the PDF.
Normally Adobe Reader users can only submit the data, XFDF, FDF, XDP, XML.
To enable usage rights on the PDF you will need to use Adobe Acrobat Std/Pro.
As for the PHP Script; it depends on your PHP web server capabilities.
The script will be slightly different, if the server uses PHP Mail or PHP PEAR.
Just attach the submission to an email and send.
If the client is submitting the form from a standalone pdf reader app, you can also respond with a success or failure FDF \status message; otherwise, you can redirect to a success / failure URL.
For more information and online examples:
http://www.pdfemail.net/examples/
Similar Messages
-
Dear friends,
I have to developed one object through which i can send
my invoice print in pdf format to the respected users email id.
Can this be also done via using attachment.
We are taking Print using va02 and out put type zsin.
Please help me out.
Thanks and Regards
vivekVivek do you mean that you want to create a attachment of type PDF and this dcouemnt is a online document and
can you let me know are you using any ABAP program or a workflow to send the email.
Try like this
In the program you make use of the FM FP_FUNCTON_MODULE_NAME and you have to call the function module that is generated by the above FM.
The Properties of ADOBE forms are associated with the structure FP_FORMOUPUT fill the relevant fields in the structure.
Now after performing the above two steps you need to convert the PDF form to BINARY for this you have to make use of the FM SCMS_XSTRING_TO_BINARY this is because you have to pass the binary content to the workflow conatiner using the Fm SAP_WAPI_WORKFLOW_START by using conatiner parameter of TABLES part.
create a Z BO or if you are familiar with OO ABAP then create a class and inside that class or BO create a method in side this method all you to do is the converted PDF to BINARY for this use
SCMS_BINARY_TO_XSTRING and after converting call the FM SAP_WAPI_ATTACHMENT_ADD.
In SAP_WAPI_ATTACHMENT_ADD you have to pass the document attributes for like name , type title, so for this you have to fill a structure of type SWR_ATT_ID and you have to pass this to SAP_WAPI_ATTACHMENT_ADD and this FM will retrun a DOC ID and you ahve to pass this ID to the TASK and the from TASK to workflow &_ATTACH_OBJECTS& in the workflow is responsible to handle the attachments...
Any more help needed revert back -
Hi all,
I'm trying to program a function in my PDF form that will automaticly save the PDF form in a folder and then sends the (just saved) PDF form attached in an e-mail.
I've got the mail function working with my submit button. The only question is how can i get my PDF form to first save and then send the form?
I've treid several saving scripts but couldn't get it working.
Could you guys help me out?
Kind Regards,
Vincent
Below my code:
// Set up the recipients,subject, body, etc.
var sTo = this.getField("Unit").value;
var sBCC = "[email protected]";
var sSubject = "Nice subject";
var sBody = "Bla bla bla";
// Set the error messge to display if it doesn't work, \r = carriage return
var sErrorMsg = "Could not send email. Please make sure your email client is set up correctly.\r\r";
sErrorMsg += "Otherwise, save this file and manually attach it to an email to: " + sTo +" [email protected]";
// Email the entire document
try {
mailDoc({
bUI: true,
cTo: sTo,
cBcc: sBCC,
cSubject: sSubject,
cMsg: sBody
} catch(e) {
app.alert(sErrorMsg, 1);To save with a script, you'll have to use the doc.saveAs method. There are a number of security related issues you'll have to deal with, as discussed here: http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript
-
PDF Form Using E-Mail shows same PDF
Hi All,
I downloaded and installed the 'TutWD_EmailInteractiveForm'.
("Offline Interactive PDF Form Using E-Mail" in the
/docs/DOC-8061#47)
I customized the readInbox method in the EmailInteractiveFormComp.
I deleted the source of "if (message<i>.getSubject().equals("Travel Request Form"))".
After I executed, there are 3 records in the window(ReceivedView).
Next, I clicked the 1st row and show the 1st row's pdf.
Then I return to the list, and click the 2nd row.
But it shows a 1st row's pdf!
Is there a person who became the same phenomenon?
Please give me some ideas!!
Regards,
HiromitsuYou can submit whole PDF format as long as you enable usage rights on the PDF.
Normally Adobe Reader users can only submit the data, XFDF, FDF, XDP, XML.
To enable usage rights on the PDF you will need to use Adobe Acrobat Std/Pro.
As for the PHP Script; it depends on your PHP web server capabilities.
The script will be slightly different, if the server uses PHP Mail or PHP PEAR.
Just attach the submission to an email and send.
If the client is submitting the form from a standalone pdf reader app, you can also respond with a success or failure FDF \status message; otherwise, you can redirect to a success / failure URL.
For more information and online examples:
http://www.pdfemail.net/examples/ -
I cannot open a .pdf in an incoming mail (Outlook 2010) with Acrobat Pro XI. It will only allow "preview". I have to copy and paste the .pdf to my desktop and then open it. What do I do to restore the 2x click in Outlook to open the .pdf? As of now, I get the following bracket opening on screen when I click on the Acrobat icon for attachment within the email: Thank you
Adobe Acrobat has stopped working
Windows can check online for a solution to the problem.
-Check online for a solution and close the program
-Close the program
Problem signature:
Problem Event Name: APPCRASH
Application Name: Acrobat.exe
Application Version: 11.0.7.79
Application Timestamp: 536b812b
Fault Module Name: Acrobat.dll
Fault Module Version: 11.0.7.79
Fault Module Timestamp: 536b80ff
Exception Code: c0000005
Exception Offset: 00cbf281
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Read our privacy statement online:
http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
If the online privacy statement is not available, please read our privacy statement offline:
C:\Windows\system32\en-US\erofflps.txtHi Gary,
I have seen this issue occur with users who have this registry setting missing or have improper permissions.
When you double click the attachment to launch the pdf it is saved and opened from the temporary folder unless saved specifically to a location.
If you dont have the below mentioned registry key or improper permissions then attachments fail to open.
Please heck if the following reg key exists:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security
or
HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\14.0\Outlook\Security
Value Name: OutlookSecureTempFolder
If the value exists, and if the value contains a valid path, Outlook 2010 uses that location for its temporary files.
If the registry value does not exist, or if the value points to an invalid location, Outlook 2010, Outlook 2007, or Outlook 2003 creates a new subdirectory under the Temporary Internet Files directory and then puts the temporary file in the new subdirectory. The name of the new subdirectory is unknown and is randomly generated, depending on your version of Outlook.
Please check the following key:
HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Outlook\Security
Note the location for: OutlookSecureTempFolder key
Check if the same folder exists in the following location and if not create a corresponding folder in the location on C:\Users\<User account name>\Appdata\Local\Software\Microsoft\Windows\......
Regards,
Rave -
Apple send me a recovery e-mail to reset my security question answers however the e-mail they send has NO link for me to click in order to reset it?! See screen shot Apple.............. Please help!!
How/where are you opening the email ? Have you tried opening it in a different browser in case the reset link is being blocked due to the security settings that you have set on the one that you using ?
-
When initiating an e mail to someone with several addresses used in the past the one I use most often does not come up in the first position. How can I get these multiple e mails prioritized?
We are talking about the Mail app, right? In the Mail menubar, click on Window and then Previous Recipients:
That eliminates the previous recipients. If you are talking about the suggestions because there are 10 people with the name 'Steve' in your Contacts, then I do not know how to eliminate those unless you change the name slightly or wait until you type the last name or some other differentiator. -
I am trying to maintain my inbox on my imac while not carrying around all my mail on my iphone. As of now, I only seem to be able to sync the inboxes. If I delete a mail on my iphone, it disappears on both the server and imac. I only seem to be able to make it move the mail to the deleted mail box and keep it there.
That's the way IMAP servers work. The messages really live on the server; the iPhone and the iMac just view them.
-
Why can't I open pdf file? Get a black box with a white x in the upper left hand corner that won't open either
I get the same thing... no matter what site i try to pull a pdf for IE10, it gives me the black x... if i use chrome it works, but my client does not want to use a different browser.
I followed the guide that Pat posted... nothing worked... I have uninstalled and reinstalled Java, Adobe reader, Adobe flash,.. upgraded to IE11, then back to IE10 due to medical software that is not compatable with IE11...
The kicker is that my Admin profile works just fine.. no issues.. so i know it has something to do with his profile....
Please.. someone... help!!! -
Hello, iam using the latest version of firefox, whenever i login into my yahoo mail account i get a stop script error, the details of the error script is mentioned below , please suggest how to stop this
the website is www.mail.yahoo.com. i was getting the same STOP script error every now and then in firefox 6 as wellI have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6. -
Hi! I've just downloaded my PDF file but when I open it with adobe reader for iPhone, the toolbar doesn't show! Can please anybody tell me why?
Hi Elena, you have to tap on screen of iPhone, toolbar will just slide in.
-Charu -
I keep trying to update my mail inbox but keep being told connection to the server has failed.
Quit the maill app completely and restart the iPad. Go to the home screen first by tapping the home button. Double tap the home button and the task bar will appear with all of your recent/open apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar. Restart the iPad.
Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.
Or go to Settings>Mail, Contacts, Calendars>Your email account >Mail>Off. Restart the iPad and go back to settings and turn mail on again and see if that works.
Or try this as well ....Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. -
Dears,
I was written some C# code on Loading event of InfoPath 2010 form. and it successfully published but when i open the form through browser it shows warning error that: The custom code in the form cannot be run. This functionality may be deactivated on
the server. For more information, contact the server farm administrator.
As shown below image
I am new to SharePointAs the error can be caused by various things .You need to check follow details:
Open SharePoint Central Admin > System Settings > Services on Server .Make sure that ‘Microsoft SharePoint Foundation Sandboxed Code Service’ is running .
When you publish a form with code behind ,you need to publish it either as a sandboxed solution or as an Administrator Approved Form .
Check if there is code in a sandbox which is partially trusted is calling a dll in GAC which is having full trust .
For more information ,please refer to these sites:
The custom code in the form cannot be run.:http://www.infopathdev.com/forums/p/19380/69465.aspx#69465
Infopath publish error : http://social.technet.microsoft.com/Forums/en-US/sharepoint2010customization/thread/856042fc-6ee8-4eda-97f8-fea2d47636ba/
Publish a form: http://office.microsoft.com/en-us/infopath-help/publish-a-form-HA101783381.aspx#_Toc262226389
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer. -
Sending PDF forms (created using SFP) as Email Attachment
Hi,
I have created bunch of ADOBE forms using SFP. They are not interactive forms. created using ADOBE Live cycle designer.
I have the Function module and by executing I can view the PDF form in print preview mode. But I have to save this in backend and attach to email.
I have a program that have to send one of the forms created in SFP as email attachment to outside SAP.
Please advice how to achieve this.
Thanks,
SanjeevHi ,
Please find below a code sample for your requirement
*& Report ZENVOI_PDF_MAIL
REPORT zenvoi_pdf_mail MESSAGE-ID ad.
TYPE-POOLS : abap .
DATA : data_for_update TYPE zdemopdf ,
hexa TYPE solix_tab.
DATA : fm_name TYPE funcname ,
param TYPE sfpoutputparams,
doc_param TYPE sfpdocparams ,
output TYPE fpformoutput .
param-nodialog = abap_true. " suppress printer dialog popup
param-getpdf = abap_true.
doc_param-langu = sy-langu.
doc_param-country = 'FR'.
doc_param-fillable = abap_true.
doc_param-dynamic = abap_true.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZDEMO_PDF'
IMPORTING
e_funcname = fm_name.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = param
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4.
CHECK sy-subrc EQ 0.
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = doc_param
data_for_update = data_for_update
IMPORTING
/1bcdwb/formoutput = output
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3.
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = output-pdf "PDF file from function module
TABLES
binary_tab = hexa.
* Envoi du mail
** CLASS-DEFINITIONS
DATA: send_request TYPE REF TO cl_bcs.
DATA: document TYPE REF TO cl_document_bcs.
*DATA: sender TYPE REF TO cl_sapuser_bcs.
data: sender TYPE REF TO if_sender_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
** INTERNAL TABLES
DATA: l_mailtext TYPE soli_tab.
DATA: iaddsmtp TYPE TABLE OF bapiadsmtp.
DATA: ireturn TYPE TABLE OF bapiret2.
** VARIABLES
DATA: mail_line LIKE LINE OF l_mailtext.
DATA: bapiadsmtp TYPE bapiadsmtp.
DATA: subject TYPE so_obj_des.
DATA : att_subject TYPE so_obj_des.
DATA : w_except TYPE REF TO cx_root .
CONSTANTS : c_defmail TYPE ad_smtpadr VALUE
'[email protected]' .
FIELD-SYMBOLS : <smtp> TYPE bapiadsmtp.
*Set subject of the mail
subject = 'Exemple de PDF interactif'.
* Set text of the mail
mail_line = 'Merci de remplir le formulaire et nous le retourner'.
APPEND mail_line TO l_mailtext .
att_subject = 'Template du PDF'.
TRY.
* Create persistent send request
send_request = cl_bcs=>create_persistent( ).
* Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
* sender =
* cl_cam_address_bcs=>create_internet_address( '[email protected]' ) .
* Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
* Read the E-Mail address for the user
* CALL FUNCTION 'BAPI_USER_GET_DETAIL'
* EXPORTING
* username = sy-uname
* TABLES
* return = ireturn
* addsmtp = iaddsmtp.
* LOOP AT iaddsmtp ASSIGNING <smtp> WHERE std_no = 'X'.
* CLEAR bapiadsmtp.
* MOVE <smtp> TO bapiadsmtp.
* ENDLOOP.
* CASE bapiadsmtp-e_mail.
* WHEN space.
recipient =
cl_cam_address_bcs=>create_internet_address( c_defmail ).
* WHEN OTHERS.
* recipient =
* cl_cam_address_bcs=>create_internet_address( bapiadsmtp-e_mail ).
* ENDCASE.
* Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'
i_copy = space
i_blind_copy = space
i_no_forward = space.
* Set that you don't need a Return Status E-mail
CALL METHOD send_request->set_status_attributes
EXPORTING
i_requested_status = 'E'
i_status_mail = 'E'.
* set send immediately flag
send_request->set_send_immediately( 'X' ).
*Build Document
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_mailtext
i_subject = subject ).
* add attachment to document
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = att_subject
i_att_content_hex = hexa.
* Add document to send request
CALL METHOD send_request->set_document( document ).
* Send document
CALL METHOD send_request->send( ).
COMMIT WORK.
CATCH cx_send_req_bcs INTO w_except.
CATCH cx_address_bcs INTO w_except.
CATCH cx_document_bcs INTO w_except.
ENDTRY.
Hope this help you .
Best regards -
Adobe PDF-based print forms - how to send pdf-form by mail?
Hello All.
I have created a PDF-form and now I want to send the form by mail without
seeing it on my screen first. I want it to be done in the backround.
I'm not using java/abap web dynpro.
Can somebody help me with this?
Thanks, Barak.hi
good
go through this link hope this would help you solve your problem
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
reward point if helpful.
thanks
mrutyun^
Maybe you are looking for
-
My iPhoto software got set up with two separate libraries of photos, one marked as default. I have saved photos to the non-default library, however now can't seem to find a way to open the non-default library. Every once in a while when I open iPho
-
Can I invoke a class that extends JAppl from another class extends JAppl
Can I invoke a class that extends JApplet from another class that extends JApplet. I need to invoke an applet then select an action which opens another applet. Thanks in advance.
-
HT1430 My inbox will not display all messages
My inbox will not display all messages
-
Subpanel scollbars in labview 8.0
HI I Just installed Labview 8.0 instead of 7.1. I my VI i use a lot of subpanels, with no scrollbars but when i compile my vi to 8.0 scrollbars are added to the subpanels, and i cant find an option to disbale them..please help.. thnx Bart B Labview
-
Unable to use Back-up Feature (Photoshop Elements 5.0)
I am running Photoshop Elements 5.0 on Windows 7. The back-up feature no longer functional. My last full back-up was a year ago. When I try to perform an incremental back-up, it hangs (Not Responding) and I have to close the program. With over 34