Highlighted

mailto: using a parameter on the adobe form.

Avatar

11-12-2008

I'm wanting to use a submit form with a mailto: function that will mail the form to the email address in a email text box on the form. Everything I have seen uses hard coded email addresses.



mailto:myemail@hotmail.com?cc=myemail@yahoo.com

I want to

mailto:"value in email text box 1"?cc= "value in email text box 2"



Thanks in advance.



Jason

Replies

Highlighted

Avatar

17-12-2008

Hey Jason I am looking for the same thing. I have a txt field on my form called Manager Email and when they click submit I would like to send the email to managers email that is in the text box on the form.
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

17-12-2008

If you have a submit button that uses the mailto protocol you can use this command to set the URL:



ButtonName.event__click.submit.target = "mailto:" + Fieldname.rawValue + any other options to the string that you want;
Highlighted

Avatar

18-12-2008

Thanks Paul. That did the trick. Here is the code that I used for my Managers_email field that is on the form. But now I have the issue of once I push the submit button it does not check for the required fields. I did this as a click event. Im not sure what a mouseup event is as I have seen others talk about using the mouseup event.



var oDoc = event.target;

oDoc.mailDoc({

bUI: true,

cTo: "email@myemail.com;" + Managers_email.rawValue,

cCc: "email2@myemail.com",

cSubject: "New Loss Memo",

cMsg: "The attached file is a filled-out form blah blah blah."});
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

18-12-2008

The click is the event you should be using. The check does not happen because you did not do a submit. You could add the command form1.execValidate() before you do the email.
Highlighted

Avatar

18-12-2008

Seems I cant get it to work. I get a dialog box that says None and then it goes to send out the email. Any thoughts? I even tried form1.#subform[0].execValidate(); doing it with and without the ; for both ways.



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

form1.execValidate();

var oDoc = event.target;

oDoc.mailDoc({

bUI: true,

cTo: "email@myemail.com;" + Managers_email.rawValue,

cCc: "email2@myemail.com",

cSubject: "New Loss Memo",

cMsg: "The attached file is a filled-out form blah blah blah."});
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

19-12-2008

Lets run a test .....in Designer add an email submit button from the Standard Object Library. Render the form and hit that button. See if any warnings about mandatory fields get shown.
Highlighted

Avatar

19-12-2008

Yep Did that also 🙂 and I do get the warnings expected. If your thinking what Im thinking is add the submit button and add an onclick event to execute the other button. I tried that also.. lol. and I also get the warning but then it proceeds to run the mailto code and send the email.. Not sure if I may have missed something or maybe my code in the submit button is missing something.