Expand my Community achievements bar.

SOLVED

Why my script (send e-mail) doesn't work?

Avatar

Level 4

Hello Guys.

What is wrong in my scrit (to send mail). I want to send an e-mail over LiveCycle just message (I want opens the Outlook for the user typing, without attachment).

var mail;
var address = "seuemail@seuprovedor.com.br";
var sub = "Assunto";
var corpo = "Texto do corpo do e-mail";
mail = "mailto: " + address + "?subject=" + sub + "&body=" + corpo;
event.target.submitForm({ cURL: mail, bEmpty: true, cSubmitAs: "PDF", Charset: "utf-8" });

Link of file: https://acrobat.com/#d=1I*dJTGL1a5vNcmlJMk76g

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The script you have is intended for sending the form as an attachment.

If you just want a button to send an email only, use the event.target.app.mailMsg. The following Javascript should help:

var vEmail = "email@address.com";

var vSubject = "A Subject for your email";

var vBody =  "Put your body message here...";

event.target.app.mailMsg({

bUI: true,

cTo: vEmail,

cSubject: vSubject,

cMsg: vBody

});

For more scripts accessing Acrobat menu items, have a look at: http://assure.ly/i2LBMC

Hope that helps,

Niall

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

The script you have is intended for sending the form as an attachment.

If you just want a button to send an email only, use the event.target.app.mailMsg. The following Javascript should help:

var vEmail = "email@address.com";

var vSubject = "A Subject for your email";

var vBody =  "Put your body message here...";

event.target.app.mailMsg({

bUI: true,

cTo: vEmail,

cSubject: vSubject,

cMsg: vBody

});

For more scripts accessing Acrobat menu items, have a look at: http://assure.ly/i2LBMC

Hope that helps,

Niall

Avatar

Level 4

Hi Niall.

How are you?

This works very very well!

Thank you for your helpful