Copy link to clipboard
Copied
Trying to execute a mailDoc function using a mouseUp action submit button.
I am at the point where it will open my email app with everything(including the email address I've set, subject, body, etc.) but not attach the pdf itself. Here is my code:
app.alert("Survey Submmited", 3); var cToAddr = "(Insert email here)@outlook.com"; var cSubLine = "Technical Skills Survey"; var cBody = "Please find the attached Skill Survey"; this.mailDoc({ bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody });
I also get this error message from the console( GeneralError: Operation failed. Doc.mailDoc:14:AcroForm:submitForm:Annot1:MouseUp:Action1)
Copy link to clipboard
Copied
That's strange. What's the exact version number of the application (You can find it out by going to Help - About Adobe Acrobat)? What's your OS version? What's your default email application?
Copy link to clipboard
Copied
Adobe Acrobat Pro version: 2023.003.20284.
My OS is Windows 10.
And my default email application is Outlook although I already tested this on a MacBook with the Mail application and ended up with the same results
Copy link to clipboard
Copied
Can you share the file in question with us?
Copy link to clipboard
Copied
It's for my job so that might go against their company policies. I'll have to consult my manager first which I won't be able to do til Tuesday
Copy link to clipboard
Copied
All I can share for now is that it's a survey form, using radio buttons for the answers. I checked the security settings but there's nothing enabled so pretty sure that's not the problem. Bizarrely, if you click the email button in the top left bar in Abode Acrobat Pro, that works fine but still need this button i've made to work.
Copy link to clipboard
Copied
Just ran your code in the console window and it not only gave me the "General Error", but also popped up a dialog indicating that the email "(Insert email here)@outlook.com", was not recognized and asking me to enter a new email.
But if the email is blank, then it works, i.e., a new email dialog is displayed with the attached PDF, and an empty "to" field.
Copy link to clipboard
Copied
That email was just a placeholder for my co-worker's email but I tried your suggestion of leaving the email blank and I'm getting the same results unfortunately(email dialog with no attachment and empty to field). But at the very least it seems that my code is correct. I suspect it has something to do with my Acrobat settings or my internal system as I've tried other people's files and they seem to not attach the pdf as well even though these users seem to have no problems doing so on their side.
Copy link to clipboard
Copied
That is indeed very odd. You are probably correct that something to do with settings is causing the issue, but I suspect the settings are corrupted in some way, rather than just set the wrong way.
Copy link to clipboard
Copied
Update! So for some reason, when I remove the cTO line in my code, the error is gone and the attachment is actually there. Problem now is I can no longer include the email address. Very weird considering there's no problems adding a subject and body but the email address is a no-go for some reason.
Copy link to clipboard
Copied
Update! So for some reason, when I remove the cTO line in my code, the error is gone and the attachment is actually there. Problem now is I can no longer include the email address. Very weird considering there is no problems adding a subject and body but the email address is a no-go for some reason.
Copy link to clipboard
Copied
If anyone knows why the cTo would cause this or an alternative that will add an email address without cTo. it would be extremely helpful.
Copy link to clipboard
Copied
Make sure it's cTo and not cTO, as JS is case-sensitive, so the latter is incorrect.
You can specify the target address under cCc, I believe, and it should work just as well.
This is a very odd error, though.
Copy link to clipboard
Copied
Strangely, getting the same error with the cCc method you suggested. For whatever reason the document doesn't want to accept emails and attachments at the same time.
Copy link to clipboard
Copied
Are you sure the email address you're specifying is a valid one? It should not contain any spaces, or "mailto:" or anything like that.
Copy link to clipboard
Copied
It definitely is. I've got another update. It seems using webmail over a local email app works perfectly (email address, subject, body, and attachment). The only problem is that when using a web browser to fill the pdf over an editor, it always goes for the local email client on submission so I still need to figure it why it has an issue with local email clients.