Hello all,
I have a form with two email address fields. One field holds the To: address and the other holds the Cc: address.
When both fields are populated, the email submit functions as expected.
I have set the submit button to check and see if an email address is present in the To: field and if that field is empty it will not allow the submit to go further. However, when the Cc: address is missing, Outlook throws up an error message saying "Microsoft Outlook does not accept Null" and asks for an address.
How to get around this? There may be instances in which a Cc: address will not be needed or provided by the user.
I would like for the submit to work as long as at least one email address is available in the To: field.
The second part of the question is, since the email address fields are simple text fields, what is the best way of entering more than two addresses in a single field. Would the addresses have to be separated by a comma, or semi-colon etc, for this to work with Outlook?
I would appreciate any suggestions.
Harry Ohm.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Harry,
I am out of the office and doing this on the phone, so i'll keep it brief.
If you wrap the line where you declare the oCC variable, in an if/else statement:
if (form1.page1.wrapper.Config.Email2.rawValue == null)
{
var oCC = "";
}
else
{
var oCC = form1.page1.wrapper.Config.Email2.rawValue;
}
This way if the cc field is blank, the variable will not be null, it will be a string of zero length.
Niall
Views
Replies
Total Likes
Hi Harry,
I have two examples here: http://assure.ly/fiTm2i
One is for users with Acrobat/Reader version 9.1 or above. The other is for earlier versions.
If you have a look at the third button in each example, you will see that I have placed the vCC variable AFTER the body string and BEFORE the submit as string. This is to suit the syntax.
Earlier in the script you will see that I declare the vCC as "" and then if the user has provided a cc address then the script assigns this
vCC = "&cc=" + ccEmail.rawValue;
Hope that helps,
Niall
Views
Replies
Total Likes
Hi Niall,
Thanks for your quick response. I was using the method below:
var myDoc = event.target;
var oEmail = form1.page1.wrapper.Config.Email1.rawValue;
var oCC = form1.page1.wrapper.Config.Email2.rawValue;
var oSub = form1.page1.wrapper.Config.subject.rawValue;
var oBody = form1.page1.wrapper.Config.body.rawValue;
myDoc.mailDoc({
bUI: false,
cTo: oEmail,
cCc: oCC,
cSubject: oSub,
cMsg: oBody,
cSubmitAs: "PDF"
});
Views
Replies
Total Likes
Hi Harry,
I am out of the office and doing this on the phone, so i'll keep it brief.
If you wrap the line where you declare the oCC variable, in an if/else statement:
if (form1.page1.wrapper.Config.Email2.rawValue == null)
{
var oCC = "";
}
else
{
var oCC = form1.page1.wrapper.Config.Email2.rawValue;
}
This way if the cc field is blank, the variable will not be null, it will be a string of zero length.
Niall
Views
Replies
Total Likes
Many thanks Niall! Works like a charm!
Harry.
Views
Replies
Total Likes