The following list shows the Public Properties from the
Control. By checking the Properties and click the "Save Properties" button at
the bottom, umbraco will create the corresponding Macro Elements.
System.Web.HttpParseException
(0x80004005): There can be only one 'control' directive. --->
System.Web.HttpParseException (0x80004005): There can be only one
'control' directive. ---> System.Web.HttpException (0x80004005):
There can be only one 'control' directive.
at System.Web.UI.TemplateParser.ProcessError(String message)
at System.Web.UI.TemplateP...............
if (string.IsNullOrWhiteSpace(kname.Text) || string.IsNullOrWhiteSpace(kemail.Text) || string.IsNullOrWhiteSpace(kmessage.Text)) { ResponseLiteral.Text = @"<br><br><p><strong>Error sending the contactform !</strong></p>"; } else { string body = "The following information has been send from your website:" + CrLf + CrLf; body += "name:" + kname.Text + CrLf; body += "company:" + kcompany.Text + CrLf; body += "email:" + kemail.Text + CrLf; body += "telephone:" + ktelephone.Text + CrLf + CrLf; body += kmessage.Text + CrLf + CrLf ; body += "Kind regards," + CrLf; body += kname.Text;
try { umbraco.library.SendMail(kemail.Text, "[email protected]; [email protected]", "Contactform from the website", body, false); ResponseLiteral.Text = @"<br><br><p>The contactform has been sent...</p>"; } catch (Exception) { ResponseLiteral.Text = @"<br><br><p><strong>There was a problem sending the contactform.</strong></p>"; } }
sendmail to more then one recipient ?
Hi,
Is it possible to send mail to more then one recipient ?
Like:
umbraco.library.SendMail(Senderemail.Text, "[email protected];[email protected]", Subject.Text, Body.Text, false);
When i load this ascx i get an error:
Error reading usercontrols/sendmail.ascx
The following list shows the Public Properties from the Control. By checking the Properties and click the "Save Properties" button at the bottom, umbraco will create the corresponding Macro Elements.
System.Web.HttpParseException (0x80004005): There can be only one 'control' directive. ---> System.Web.HttpParseException (0x80004005): There can be only one 'control' directive. ---> System.Web.HttpException (0x80004005): There can be only one 'control' directive. at System.Web.UI.TemplateParser.ProcessError(String message) at System.Web.UI.TemplateP...............
Hi Maarten,
As far as I'm aware, you are delimiting the recipients correctly (by semicolon).
Does the form/email work when you use a single email address?
I'm getting a sneaky feeling that there's something else going on here - only from the exception message.
Cheers, Lee.
Yes, single recipient works just fine. I'll post the script tomorrow.
Maarten
Hi Lee,
As promised here is my code....
I changed the script a little bit. When i load this usercontrol in the macro, i dont get any error now..
But when i send this contactform, only the last recipient receives the mail... (not the actual email adresses)
Any idea why not both recipients receive the mail ???
Also i would like the recipients to be a parameter when i insert the macro in the richtext box.
Maarten
Is the mail server showing you the messages for the delimited users, or is it failing before it gets to the mail send?
The mailserver is showing the message, but only to the last recipient... in this case peter
I found the solution...
THE recipients have to be parted with a komma. [email protected], [email protected].
Maarten
does that apply to both the to and the cc field and apologies for the late responses.
Yes Ravi,
According to .NET
Maarten
is working on a reply...