How to send email using javaScript with a .pdf attachment

I would like to know how to code up something using javaScript that would email a pdf document without having to use an Outlook account or webmail account. I would like to have this sent directly to a specific email address. I've been searching for examples of code to no avail.

Is this possible? Please help!


Bobbye Archer


2 Answers

Can you email without using some sort of email client associated with an email server?

Emails have a very special format that is processed by email server programs using the SMTP or other mail transfer protocol.


George Kaiser   

Here's three examples that might help:

Emailing a PDF To mail the PDF document to the specified e-mail address when the button is selected, in the script window, enter the following text in the exact format, and click OK:

// use mailDoc in this routine

this.mailDoc(true, "yourname@address.com", "cc goes here", "bcc goes here","Subject goes here"); +++++++++++++++++++++++++++++++

this.mailDoc({

bUI: false,

cTo: "john@yourcompany.com",

cCC: "peter@yourcompany.net",

cSubject: "Beta Test Report",

cMsg: "This attached PDF form has been completed as requested. Thanks from George Howard for completing this form. He will use this information to improve his website." });

+++++++++++++++++++++++++++++++

// This is the form return email. It's hardcoded // so that the form is always returned to the same address. // Change address on your form to match the code below var cToAddr = "formsAdmin@yourcompany.com"

// First, get the client CC email address var cCCAddr = this.getField("ClientEmail").value;

// Now get the beneficiary email only if it is filled out var cBenAddr = this.getField("BennyEmail").value; if(cBenAddr != "") cCCAddr += ";" + cBenAddr;

// Set the subject and body text for the email message var cSubLine = "Employee Performance Evaluation Form" var cBody = "This form has been completed as per company policies and submitted for your review.\n" + "If you need clarification or have questions you may contact me using the from address in this message.\n"+"Please save the filled PDF form attachment for your own records and open it with Adobe Reader."

// Send the entire PDF as a file attachment on an email this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});


Eugene Williams   


Please specify a reason: