Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

How to send a document by mail

Avatar

Level 2

Hi,

I am currently creating a document that must be filled in by the user, and then send to a mailbox (for later treatment).

I have thus created a form, with some fields and a button.

This button must do the document validation then, if it is a valid document, send it by mail to the mailbox, and then close the document.

The document must be sent to the mailbox in the PDF format !

Anyone can help me to do that ?

Thanks in advance,

Regards,

Olivier Mahieu

P.S. : I have already read some threads on the forum and tryed to do it, but without success...

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi Olivier,

Here is the form back to you: https://acrobat.com/#d=Hb8JjB*yu6HdtTvy4bFehA

When the form is open in Acrobat (or Preview) pressing Control+J will bring up the Javascript Console. This showed that the full reference for PostalCode was not provided.

Acrobat1.png

Changing the switch statement to the following worked:

switch (Page1.Table.PostalCode.rawValue)

{

     ...

I see that you are using Paper Based Barcodes. These will only work in Acrobat or in Reader if the form is Reader Enabled with the full LC Reader Extensions ES server product. Reader enabling the form in Acrobat will not turn on the barcode functionality.

Good luck,

Niall

View solution in original post

12 Replies

Avatar

Level 10

Hi,

Here is a sample with three options for email buttons: https://acrobat.com/#d=2W4mi8OiEHBYfsXEWJcMcA

The first one uses a custom script to go straight to the email client.

The other two are built-in buttons, which ask the user if there want to use a desktop email client first.

Once you have the email working, you can add in a script at the end to close the form:

app.execMenuItem("Close");

More examples of execMenuItem scripts are available here: http://assurehsc.ie/blog/index.php/2010/05/script-to-access-acrobat-menu-items/

Good luck,

Niall

Avatar

Level 2

Hi,

Thanks for your quick answer !!

I tried the first solution, but nothing happened ... no mail , pdf not

closed ...

Is there a way to debug the script ?

Avatar

Level 2

Hi,

Thanks for your quick answer !!
I tried the first solution, but nothing happened ... no mail , pdf not closed ...
Is there a way to debug the script ?

Avatar

Level 10

Hi,

Give us a chance... bumping the thread isn't helping!

Does the first solution in the original sample file work for you? It works here using Acrobat 9 and Microsoft Outlook and Microsoft Entourage. What email client are you using? I am fairly sure it will work in earlier versions.

Try your form in Acrobat and not in Preview (in LC Designer). I have found that the email button does not work in Preview.

I would recommend getting the email to work first and then add the close script.

To debug script press Control+J in Preview or Acrobat to open the Javascript Console. If there is a problem it is likely to show up there.

Niall

Avatar

Level 2

Sorry for the bumping, was not on purpose ... We have some problems with the

network and I couldn't know the response was already sent ...

I m working with acrobat 9 pro extended, live cycle 9, outlook 2007 and an

exchange server.

I had though about the preview problem possibility and tried with acrobat,

but doesn't work either ...

I'll try to debug and keep you informed

Olivier

Avatar

Level 10

OK Olivier,

Your spec matches what we have here. Try the original sample first to try and identify the issue and then work through the implementation in your form.

Here is a screenshot of the first email button working.

Microsoft Entourage1.png

Good luck,

Niall

Avatar

Level 2

Is there a way to send the mail directly, without opening the mail window

and without the user having to click the "send" button ?

Avatar

Level 10

Hi,

No (not as far as I know). The script basically hands over control/focus to the email client. Adobe are very conscious of users' security and would consider it unacceptable for an email to be sent by script without the users' knowledge or consent.

The best you can achieve with email is to open the email with pre-populated email address, subject line and message. The user will have to click Send.

Niall

Avatar

Level 2

Ok, here is my pdf ... can you tell me what s wrong ?

The structure is shitty because i imported it from a .doc file ... but i

only use this to try the adobe product and prove to client that it is good

(is it ?).https://docs.google.com/fileview?id=0B4F1mW6MxfgKYjJkZTExMjItOTM3NC00M2RkLWI1ZWQtYmQ1ZGM1NmRhMDM5&hl...

Avatar

Level 10

Hi,

You can't upload files onto the forum. You would have to use Acrobat.com or yousendit.com or some other file sharing site.

Because it has been imported from Word that may be a problem. It shouldn't but I can check when I get the form.

Yes, LC Designer is good

Niall

Sorry, I have the file now...

Avatar

Correct answer by
Level 10

Hi Olivier,

Here is the form back to you: https://acrobat.com/#d=Hb8JjB*yu6HdtTvy4bFehA

When the form is open in Acrobat (or Preview) pressing Control+J will bring up the Javascript Console. This showed that the full reference for PostalCode was not provided.

Acrobat1.png

Changing the switch statement to the following worked:

switch (Page1.Table.PostalCode.rawValue)

{

     ...

I see that you are using Paper Based Barcodes. These will only work in Acrobat or in Reader if the form is Reader Enabled with the full LC Reader Extensions ES server product. Reader enabling the form in Acrobat will not turn on the barcode functionality.

Good luck,

Niall

Avatar

Level 2

Hi,

Thanks again !!

I just saw that stupid mistake ...

Sorry to have take so much of your time for such a stupid mistake ...

This document will be a demo for a client, i try to include the most i can.

The client will choose what to use ...