I'm trying to modify what the body of the email will look like once the user has pressed an email submit button. In Livecycle designer, I clicked on the button and viewed the xml source. I scrolled down to the following line:
<submit format="xml" textEncoding="UTF-8" target="mailto:test&test.com?subject=My subject"/>
Then changed it to:
<submit format="xml" textEncoding="UTF-8" target="mailto:test&test.com?subject=My subject?body=new body"/>
When using the mailto the parameters are preceded by a ? and all subsequent parameters are separated
by an &. Also the email address needs an @ not an &. So your command woudl be:
<submit format="xml" textEncoding="UTF-8" target="mailto:firstname.lastname@example.org?subject=My subject&body=new body"/>
Thanks for the reply,
I've tried your code however I get the following error:
The following error was found with the XML source:
Xml parsing error: not well-formed (invalid token) (error code 4), line 2430, column 176 of file
Do you know what this means?
I'm basically trying to remove the default email body that appears when the "submit by email" button is clicked, ie:
The attached file contains data that was entered into a form. It is not the form itself.
The recipient of this data file should save it locally with a unique name. Adobe Acrobat Professional 7 or later can process this data by importing it back into the blank form or creating a spreadsheet from several data files. See Help in Adobe Acrobat Professional 7 or later for more details.
I can't even find the above text in the xml code so I dont' even know how to remove it.
Any further help with these problems, would be much appreciated.
if you need an easy way to design the mailTo button you can use my macro for Designer (9.x and 10.x).
It will add a mailTo script to a regular button.
Yeah I meant to say that I was editing the xml source, and not using the script editor.
Thanks for agreeing to look at my file which I've sent by email.
Radzmar: thanks also for the link to your macro - I will keep this in my for future projects.
Instead of using the email object from the Custom library, use a regular button and choose "Submit" as the control type. Then in the Submit tab, in the "Submit to url" field, add something like the following:
mailto:email@example.com?subject=Application Form&body=new body
Hope that helps.
I would love to have this question answered too. Also, does anyone know how to enter returns into the email body text? Currently all I'm able to do is write the body text as one line.
What I ran across in my searching (that worked) was to create hidden fields that contained the data I wanted to use. I also used a "dummy" submit button. The "real" submit button was created as a literal submit button and the following code inserted into the click event of the "dummy" button (which is a Regular button)
This code was modified from another's answer, but does the job. The field "SUBJECT" is set as "Hidden" in the presence drop-down of the object tab. I suspect one could add '&body=' as follows
You would create the field "BODY" and insert the message text and call the formatted value to fill it in. Set the field to "Hidden" so it does not affect your form layout. I am open to being corrected by more experienced scripters (Please and thank you) if I am in error, here.
If you choose to use fields the user has filled in, then yes. If you choose to use fields that you have filled and set to hidden, then the user will not see them, but the script WILL and it will use the data contained in them to generate the email subject/body.
For the life of me I can not find this macro to download. The link I click on which is supposed to lead me to the macro does not work. Can you please post a link to the download. Thank you.
(MailTo maker Macro)
You can do the following:
You have to use a normal button!!
//fill in e-mail
var Mailto = Formular1.s1.email.rawValue;
//var Mailto = "firstname.lastname@example.org";
//fill in subject
var SubjectBetreff = Formular1.s1.betreff.rawValue;
//var Betreff = "Test-Betreff";
//fill in message
var MessageNachricht = "Content PDF:\r" + "Field content: " + Formular1.s1.inhalt.rawValue + "\rName: "
+ Formular1.s1.name.rawValue + "\rDatum: " + Formular1.s1.datum.formattedValue;
//var Nachricht = "This is a test message.\r2.row start here.\r3.row here.";
//fill in e-mail cc
var CC = Formular1.s1.emailcc.rawValue;
//var CC = "email@example.com";
//fill in e-mail bcc
var BCC = Formular1.s1.emailbcc.rawValue;
//var BCC = "firstname.lastname@example.org";
var Mail = "mailto:" + Mailto + "?Subject=" + SubjectBetreff + "&Body=" + MessageNachricht + "&cc=" + CC + "&bcc=" + BCC;
//cSubmitAs: "PDF" send the pdf as attachment
//cSubmitAs: "XML" send the pdf as xml-attachment
Hope it will helps you,
Kind regard Mandy
I was unable to get Mandy's script (proceeding entry) to format the email text on a MS Windows Outlook email. File attached. All the email did was populate in Plain Text.
I tried this option. It works fine. As long as the variable MessageNachricht does not contain an '&' (ampersand). If it does, the text in the body of the email will stop at that '&'.
Does anyone know how to avoid that? How can I change it to include text with '&' in the body of the email? Or it there a way to prevent people from using the '&' in the form (apart from just asking them, of course).
I don't see any problems using ampersand characters at my end.
Even rich text values are processed successfully as plain text into the mail subject and body.
I've used a macro to create the mailing script.
It simply picks values from form fields andcombines them together with a default message.