cancel
Showing results for 
Search instead for 
Did you mean: 

PDF Email - via user input email

Former Member
0 Kudos

Hi,

I am trying to send adobe form which will be filled by user.

I was able to email it if I have the email populated already in the form.

For this I have used normal submit button,changed control type to submit and used mailto: in URL.

I have used following code in form:ready event of the button.

this.resolveNode("#event.#submit").target = "mailto:"+$record.ITEM.PEMAI.value;

This works fine..

I also want to give user an option for entering email or should overwrite the existing email.How can I accomidate this?

Rgds

Vara

Edited by: Vara K on May 11, 2009 5:48 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Vara,

you can use a button (Control Type: Regular) and in the click event a javaScript like following:

var lEmail=xfa.record.ITEM.PEMAI.value;
var myDoc = event.target;
try {
  myDoc.mailDoc({
    bUI: false,
    cTo: lEmail,
    cCC: "",
    cSubject: "Subject",
    cMsg: "..."
    });
} catch (e) {}

Regards

Michal

Former Member
0 Kudos

Hey Michal,

it worked!! thank you.

I am also trying to CC .Let me know what is wrong in this code.

I want to CC for 4 people.

var lEmail = xfa.record.ITEM.PEMAI.value;
var 2Email = xfa.record.ITEM.PPCC1.value;
var myDoc = event.target;
try {
  myDoc.mailDoc({
    bUI: false,
    cTo: lEmail,
    cCC: 2Email,
    cSubject: "Subject",
    cMsg: "..."
    });
} catch (e) {}

Rgds

Vara

0 Kudos

hi michal,

the code you have given is working, but when you click on button it sends pdf document with some unknown name like fji8389.pdf,

i want to set this name which is appropriate like sampleform.pdf

how to set the pdf file name before sending mail?

Thanks,

Madhu.

Former Member
0 Kudos

Hi Vara,

I wrote an error in my code. Use cCc instead of cCC.

Don't start variable names with a digit.

Regards

Michal

Former Member
0 Kudos

Hi Madhu,

it is the name of your form (maybe in Temp folder). I don't know how to change this name.

Regards

Michal

Former Member
0 Kudos

Thank you Michal.

cc works now.

but how do I include multiple addresses? what is wrong in this code?

var lEmail = xfa.record.ITEM.PEMAI.value;
var CEmail = xfa.record.ITEM.PPCC1.value;
var BEmail = xfa.record.ITEM.PPCC2.value;
var myDoc = event.target;
try {
  myDoc.mailDoc({
    bUI: false,
    cTo: lEmail,
    cCc: CEmail;BEmail,
    cSubject: "Project Request For Information",
    cMsg: "Dear Customer,.........."
    });
} catch (e) {}

Former Member
0 Kudos

Hi Vara,

use the following code:

var lEmail = xfa.record.ITEM.PEMAI.value;
var CEmail = xfa.record.ITEM.PPCC1.value+";"+xfa.record.ITEM.PPCC2.value;
var myDoc = event.target;
try {
  myDoc.mailDoc({
    bUI: false,
    cTo: lEmail,
    cCc: CEmail,
    cSubject: "Project Request For Information",
    cMsg: "Dear Customer,.........."
    });
} catch (e) {}

Regards

Michal

Former Member
0 Kudos

It worked like a charm!!

Thank you.I have awarded you full points.

rgds

Vara

Answers (0)