Security Warning Message when picking a send to email address for a form

New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

I have created a form and need to be able to let the user pick the email address from a drop-down menu, for the person who needs to receive the completed form. I have named the drop-down field "EmailTo" and used this script I found on tutorials.

 

// Set the target email address based on the selection in the field

var cToAddr = this.getField("EmailTo").value;

// Set the subject and body text for the email message

var cSubLine = "Legal Document Submission"

var cBody = "Thank you for submitting your form.\n" + "Save the filled form attachment for your own records.\n" + "Attach the orginal legal document to this email"

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

 

warning.jpg

I am getting this security warning message when I pick an email address and want to know if there is a way to prevent it from popping up.

Thank you for any assistance.

TOPICS
JavaScript, PDF forms

Views

338

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct Answers

Adobe Community Professional , Apr 05, 2021 Apr 05, 2021
It seems the value of this field is not an email address but some text ("set the target email address..."), which the script is then trying to use as the target email. This will not work, of course. You have to either replace that text with an empty string, or not proceed with sending the file if the entered value is not a valid email address.

Likes

Translate

Translate
LEGEND , Apr 05, 2021 Apr 05, 2021
It is picking up the text "set the target email address..." This is NOT coming from the comment (though I can see why you might think so). It is probably coming from a form field. Check all your form fields for this text. My guess is that you have this in the list of emails, as well as some email addresses.

Likes

Translate

Translate
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

What have you selected in the dropdown? Where does you use the script?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

I have selected an email address in the drop-down. I want this email address to auto-populate in the users email client when the “attach to email” button is clicked. When I select an email address, I immediately get the security warn. Screenshot below. The Email to field is the drop-down with 3 different choices and the script is on the attach to email button



Sent from Mail for Windows 10

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

At the dropdown have you only the 3 choices or more?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Yes, but I need to add another email address so there will be 4. Client just made changes!

Sent from Mail for Windows 10

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Is the text "set the target email address..." one of the choices or export values.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

TinaE509_0-1617643892258.png

This is the dialog box, there is a field for export value, I don't know what to put there though

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

It seems the value of this field is not an email address but some text ("set the target email address..."), which the script is then trying to use as the target email. This will not work, of course. You have to either replace that text with an empty string, or not proceed with sending the file if the entered value is not a valid email address.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

warning.jpg

 

Thank you for the response, I do not know Javascript but can see now that the security warning is saying it is trying to connect to what I thought was just a comment in the script, it's the first line. Any suggestions to fix this code would be greatly appreciated.

 

// Set the target email address based on the selection in the field

var cToAddr = this.getField("EmailTo").value;

// Set the subject and body text for the email message

var cSubLine = "Legal Document Submission"

var cBody = "Thank you for submitting your form.\n" + "Save the filled form attachment for your own records.\n" + "Attach the orginal legal document to this email"

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody});

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

It is picking up the text "set the target email address..."

This is NOT coming from the comment (though I can see why you might think so).

It is probably coming from a form field. Check all your form fields for this text. My guess is that you have this in the list of emails, as well as some email addresses.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Also, WHERE do you use the script? This is critical, there are many different places a script can be. Nothing works in the wrong place.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Thank you so much, it was indeed coming from the drop-down menu set-up box, it was in the url field, oops! Thanks again for helping me track this down.

Sent from Mail for Windows 10

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Can you share the form?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Attached is my test version using my personal email addresses. Removing the text "// Set the target email address based on the selection in the field" from the url field got rid of the security warning message.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

Working fine for me...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

LATEST

It works without any issue.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines