These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Syntax for multiple addresses in mailForm()

David Dunn
Registered: Oct 28 2010
Posts: 116

Can someone please tell me the correct syntax for this. I've been through all of API examples for every type of mail method, but they all assume you are mailing to known addresses as a string rather than addresses gathered from variables.
 
I have two email addresses in the fields identified as the variables 'address' and 'address2' below. I want both variables included in the 'cTo' parameter of mailForm(), separated by a semicolon. My syntax must be incorrect because only one of the addresses appears in the 'To' field when the e-mail client write message opens.
 
var address = this.getField("txtTPS.Atty.E-mail").value
var address2 = this.getField("txtTPS.Atty.ContactE-mail").value
var fileNo = this.getField("txtHDR.FileNo").value
var seller = this.getField("txtHDR.SName").value
var buyer = this.getField("txtHDR.BName").value
 
this.mailForm(true, address +"; " +address2, "","", fileNo + " " + seller + " sale to " + buyer, "");

David D

My Product Information:
Acrobat Pro 9.4, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Your code works for me using Acrobat 9 and Outlook 2002 (which I never use). You might want to remove the space after the semicolon. What email client are you using?
David Dunn
Registered: Oct 28 2010
Posts: 116
That was fast ... thank you. I use an email client called Chaos Intellect (www.ChaosSoftware.com). It's a great program, but I think that is the source of the problem, not my script. I read in John Deubert's "Extending Acrobat Forms with JavaScript" that the results of various js mail methods are spotty from client to client. My script opens the mail and enters the first address and subject heading, but won't input the second address, the cc, bcc or body text.

David D