Skip to main content
Italian4215
Inspiring
January 28, 2016
Answered

Send email without having email client open? (need for work)

  • January 28, 2016
  • 1 reply
  • 1035 views

Hi, I am creating a contact us form which I need to pull info from and send to several emails; however, I do not want the email client to open into a compose message. I just want the info sent to those emails specified.

Here is the code I currently have:

var cMyMsg = this.getField('Name').valueAsString + " has a " + this.getField('Category').valueAsString + " that is " +
this.getField('Severity').valueAsString + ". " + "Description of " + this.getField('Category').valueAsString + ": " + this.getField('Description').valueAsString;


app.mailMsg({  bUI: true,  
cTo: "123@email.com", 
cSubject: this.getField('Category').valueAsString + " regarding PA Coversheets", 
cMsg: cMyMsg } );

I currently have an text field set up for Email_Address. I need the form when submit is clicked to send email from that address to the emails I specify in the code without having the email client open.

Please help. Thank you.

This topic has been closed for replies.
Correct answer Italian4215

I have it as a mouse up event that runs a javascript. I changed the BUI to false. and that did the trick. Thanks.

1 reply

try67
Community Expert
Community Expert
January 28, 2016

As is documented in the API, you'll have to run the script from a privileged context to be able to do that, ie from a folder-level script.

Italian4215
Italian4215AuthorCorrect answer
Inspiring
January 28, 2016

I have it as a mouse up event that runs a javascript. I changed the BUI to false. and that did the trick. Thanks.

try67
Community Expert
Community Expert
January 28, 2016

It should not have done. This parameter should have been ignored when you run this code from a button.

It's not possible to do that with attachments. But if a file is attached to the main PDF just submit the PDF itself and it will be sent along with it.