Forums

[SOLVED]Can't send email to user because antispam blocking

?
Guest 24 Jun, 2011
Hello.

I use chronoforms because it is powerrfull form component. I've created the complaint form. So email of registered user I can get in this way

PHP code
$user = &JFactory::getUser();
$useremail = $user->email;


Then I insert it into hidden field in my custom code:

HTML code
<input type="hidden" name="useremail" value="<?php  echo $useremail; ?>">


Then in action after submit I added this field in dinamic field From:

And get this error message

Language string failed to load: invalid_address: This e-mail address is being protected from spambots. You need JavaScript enabled to view it. Language string failed to load: invalid_address: This e-mail address is being protected from spambots. You need JavaScript enabled to view it. Ошибка в перечисленных адресах отправителей: This e-mail address is being protected from spambots. You need JavaScript enabled to view it.



Javascript is enabled in my Firefox.

How to solve this problem?
GreyHead 24 Jun, 2011
Hi Roman Petrenko ,

You have the Joomla! Email Cloaking Plug-in enabled and it is trying to cloak the sample e-mail in the ChronoForms validation message. Disable the plug-in temporarily to check this is the problem. If you need the plug-in change the plug-ins order so that Email Cloaking runs before ChronoForms.

NB These are Joomla! plug-ins that you manage from Site Admin | Extensions | Plug-in Manager

Bob
?
Guest 24 Jun, 2011
LOL😀 😶

Plug in EmailCloack need to be before chronoforms plug in.

Thank you very much!
chumby 25 Jun, 2011
Hi,

I'm having this trouble as well and changing the cloaking order doesn't help.

Error shows below:

Language string failed to load: invalid_address: [email]reception.claremont@cooperautomotive.com.au[/email]; [email]claremont@cooperautomotive.com.auThank[/email] you ! Your quote has been submitted to Cooper Automotive.

The value: [email]reception.claremont@cooperautomotive.com.au[/email]; [email]claremont@cooperautomotive.com.au[/email]

is passed through from the form select option to the dynamic section of the email template.

Joomla 1.6,

Cheers
Chumby
GreyHead 25 Jun, 2011
Hi chumby,

I see the site is off-line which makes it hard to check :-(

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

ob
chumby 25 Jun, 2011
Details sent Bob...
GreyHead 25 Jun, 2011
Hi chumby,

The problem is that you are trying to set a list of two To addresses from the drop-down select box. For some reason the Joomla! mailer foesn't like the result and is showing an error message. The 'language string not found' appears to be a Joomla! bug related to this :-(

I've copied the first option in the drop-down and removed one of the emails and that version now works.

I'm not sure what causes the problem with the two addresses. I've tried changing the separator from ; to, and removed the space with no effect. Possibly the mailer is looking for an array.

Either way this is probably better managed with some custom code in the OnSubmit Box.

Bob

I strongly recommend that you do *not* use the Dynamic From Email element in your Email Setups. Using this often results in your emails being marked as spam and dropped into a spam filter. Instead use the static From Email with an address that matches the site domain name and use Dynamic ReplyTo Email for the user email. The result is the same but with a much better chance of good delivery.
chumby 25 Jun, 2011
Hi Bob,

Thanks for this. No idea why it is not working now... the form worked all ok with prior version of Chrono/Joomla and two emails in the drop down.. Oh well.

SO I can see what you are saying but am a little confused how to set this up then.

Depending on the value of the drop down (eg Claremont), I need the email to be sent to TWO emails - reception.claremont@coop... and claremont@...

I also need it CC'd into mark@... and blind CC's into [email]martinpchambers@gmail.com[/email]

Where should I put in these values?

Cheers
Chumby
GreyHead 26 Jun, 2011
Hi Chumby,

I dug into the code. It will accept a comma separated list in the Static or Dynamic To boxes of the Email Configuration but will not recognise a list in the Dynamic value submitted from the form.

Here's a solution that also avoids showing the emails in the browser page. In the Form HTML set the drop-down to just return the location:
<select name="quote_location">
<option value="claremont">Claremont</option>
<option value="hobart">Hobart</Hobart>
<option value="howrah">Howrah</option>
<option value="kingston">Kingston</option>
<option value="lindisfarne">Lindisfarne</option>
<option value="moonah">Moonah</option>
</select>

Add this code snippet in the 'Custom Code - Before Email(s)' box on the code tab (correct the domain names):
<?php
$loc = $form->data['quote_location'];
$form->data['to_email_1'] = '';
$form->data['to_email_2'] = '';
if ( $loc ) {
  $form->data['to_email_1'] = $loc.'@your_domain.com';
  $form->data['to_email_2'] = 'reception.'.$loc.'@your_domain.com';
}  
?>
This will add two data items to the form 'to_email_1' and 'to_email_2' corresponding to the two emails for each location.

In the Email setup put this in the Dynamic To box
to_email_1,to_email_2


That's it.

You can add the other emails directly in the Static CC & BCC boxes on the Email setup. But note that our experience is that if your site uses the PHP Mailer function CC & BCC are not supported (they work OK with SMTP).

Bob
chumby 26 Jun, 2011
Thanks Bob,

Works a treat...

Cheers
Martin
jhainsworth 20 Mar, 2012
Hi, Bob.

I have a similar problem, with needing to send email dynamically to multiple recipients, but this solution doesn't work for me.

The number of recipients is dynamic. I don't know up front how many there will be.

What I am doing it querying the users joined to the user_group_map to get the email addresses of all the members of a joomla group. This code works fine and gives me a hidden field which contains a comma separated list of email addresses, i.e. [email]joe@xx.com[/email],tom@yy.org,sally@zz.net.

So, is there any way to get this to work? Or, is there a way to call the mailer, in php, so I can send individual emails to each person.
GreyHead 21 Mar, 2012
Hi jahinsworth,

Pleae try my customEmail [GH] action. That should accept a form variable containing a comma separated list of emails.

Bob
This topic is locked and no more replies can be posted.