Expand my Community achievements bar.

Submit via email works standard document but not embedded in IE

Avatar

Former Community Member

Hi Everyone,

First off, thank you for a such a great forum I have been trawling it for scripting in to make my document work basically. Its a quote form for a transport company; at the bottom of the document their is two buttons print and email.

- When you click email, it grabs some data from the form to generate the subject of the email and attaches a read only copy of the PDF then opens in your mail client (Outlook 2k3 in our case) you click send and away it goes to be filed on our sharepoint website.

- When you click print, it grabs some data from the form to generate the subject of the email  and attaches a read only copy of the PDF then opens in your mail client, you click send and away it goes to be filed on  our sharepoint website, then a print box pops up to get a paper copy.

Basically it happens this way because we are using sharepoint for compliance to store all our quotes. When the you open the PDF standalone from a PC, it works perfectly. But, we are hosting the document on our companyweb/sharepoint site; and it does not send as an email. The Outlook new email window filled with data does not pop up. I do not even know where to start with this problem.

Can anyone please point me in the right direction? My button code is below:

----- form1.#subform[0].PrintButton1::mouseDown: - (JavaScript, client) ----------------------------

for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
var oFields = xfa.layout.pageContent(nPageCount, "field");
var nNodesLength = oFields.length;
// Set the field property.
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
oFields.item(nNodeCount).access = "readOnly";
}
}

----- form1.#subform[0].PrintButton1::click: - (JavaScript, client) --------------------------------

//Create a variable to hold the document object
var oDoc = event.target;
oDoc.mailDoc({
     bUI: false,
     cTo: "quotes@company1.com",
     cSubject: "Quote for " + sendername.rawValue + " as quoted by " + quotedby.rawValue + " on " + quoteddate.rawValue + "."
})

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 1, 0, 0, 0);

5 Replies

Avatar

Former Community Member

If it works stand alone then I do not think there is anything wrong with your code. I woudl suspect that something in your OS is blocking the call that is being made from the browser to the mail client api. This is normally blocked by virus scan software so that malicious programs cannot use yoru computer and mail programs to generate spam.

There is another possible way but you will need to do a test first. Put a submit button on the form and set the submit url to mailto:anyvalidemail address@test.com

Serve the form up from the Sharepoint site and see if the mail dialog pops up when the button is clicked. If it works we can adjust the email button to use this technique instead.

Paul

Avatar

Former Community Member

It works fine standalone it also works on some of my clients computers but not others. After creating a new button with a submit to function point to mailto:address@company.com this did not work either.

The conclusion I have come to, is it a security setting at one office in particular, how would I find out which security setting this is?

Avatar

Former Community Member

I know that virus scan software wil block access to the email apis so I would start there.

Paul

Avatar

Former Community Member

Virus scanners are the same across both places. They are configured from a management console that is company wide.

Avatar

Former Community Member

Worked it out. Once you said security settings I realised it was only one office having the problem I realised it was the only site with its own Internet connection rather than VPN which caused me to remember it has different GPO policies. GPO was blocking it. All fixed. Thanks.