It's not difficult, just get a copy of the source and open up the CultivContactForm.sln file in Visual Studio (you can also use the free VS Express if you don't have VS installed).
Then just make the code change (fold open te .ascx file to find the .cs file).
Finally, in the Build menu, choose Build Solution and then have a look in the bin folder of where you unzipped the contact form source, there should be a CultivContactForm.dll. Put that in the bin folder of your website and you should be able to use it just fine.
"Error1'System.Array' does not contain a definition for 'Trim' and no extension method 'Trim' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)C:\Users\spookytoast\Downloads\cultivcontactform-57140\CultivContactForm\UserControl\CultivContactForm.ascx.cs7684CultivContactForm"
Alright, compiled that time, but now I'm getting a validation error in the admin UI that the mail format is wrong. ("Your data has been saved, but before you can publish this page there are some errors you need to fix first")
(If you're reading along, later we discuss that you'll ALSO have to update your form validation in the docType for your contact page... fyi)
Hey Kyle, sorry for the late reply, I didn't get a notification email about it.
This is a strange error, are you using strange characters in the e-mail addresses? Like ø or ñ? Have you tried with a single e-mail address? And have you tried fictional addresses like [email protected],[email protected]
No apologies necessary, I appreciate your attention!
I rebuilt the .dll and overwrote the existing one again, just to be sure. I tried your varients in the mail address, same error. A single, "non-split" address works fine. Wouldn't form validation live elsewhere than how a field is parsed?
Allow for more than one recipient?
Is there a modification that will allow for more than a single "To" recipient from the web form?
Thanks!
Not at the moment. Just grab the source and change:
to:
var toMailAddresses = GetPropertyFromAlias("contactMailTo").Split(',').Trim(); foreach (string toAddress in toMailAddresses) { mail.To.Add(new MailAddress(toAddress)); }
Then you can just comma-seperate the recipient addresses.
Thanks for your quick response. I presume this means recompiling from source in VS? I haven't done such high-end tasks yet.
It's not difficult, just get a copy of the source and open up the CultivContactForm.sln file in Visual Studio (you can also use the free VS Express if you don't have VS installed).
Then just make the code change (fold open te .ascx file to find the .cs file).
Finally, in the Build menu, choose Build Solution and then have a look in the bin folder of where you unzipped the contact form source, there should be a CultivContactForm.dll. Put that in the bin folder of your website and you should be able to use it just fine.
On build I am getting this error;
Of course, that was silly of me, the Trim() is in the wrong place, try this:
Alright, compiled that time, but now I'm getting a validation error in the admin UI that the mail format is wrong. ("Your data has been saved, but before you can publish this page there are some errors you need to fix first")
(If you're reading along, later we discuss that you'll ALSO have to update your form validation in the docType for your contact page... fyi)
Hey Kyle, sorry for the late reply, I didn't get a notification email about it.
This is a strange error, are you using strange characters in the e-mail addresses? Like ø or ñ? Have you tried with a single e-mail address? And have you tried fictional addresses like [email protected],[email protected]
No apologies necessary, I appreciate your attention!
I rebuilt the .dll and overwrote the existing one again, just to be sure. I tried your varients in the mail address, same error. A single, "non-split" address works fine. Wouldn't form validation live elsewhere than how a field is parsed?
check out the CultivContactForm document type,
it has a property contactMailTo with next validation set:
[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?
remove validation or update it so it accepts ','-seperated e-mails,
then you'll be able to save in your backoffice.
D'oh of course! I should've remembered that! ;-)
I hate it when this forum eats my posts.
That did the trick nicely. Here's the extended regex to allow for more than one comma-delimited email addresses:
([a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?,?)+[^,]
Thanks!
is working on a reply...