The support gave us a code, to get the file attached to email. but the result was this.
Nome: teste
DDD + Telefone : 11 55555555
E-mail: andre@next4.com.br
Selecione o contato: Comercial
Deixe sua mensagem: teste
Enviar arquivo: /var/www/vhosts/next4dev.com/httpdocs/clientes/p3image/components/com_facileforms/uploads/certisign.png
And the file is not attached, and the file path is not linked I would leave it like <a href="
www.site.com.br/upload/arquivo.xxx
"> Download a >.
Follow past the code above.
$this->execPieceByName('ff_InitLib');
$from = ff_getSubmit('email');
$fromname = ff_getSubmit('Name');
$subject = 'Envio Finalizado'; // Change to your preferred Email subject
$recipient = 'andre@next4.com.br'; // Change to your admin Email address
$body = '';
$attachToAdminMail = JRequest::getVar('attachToAdminMail', array());
if (count($this->maildata)){
foreach ($this->maildata as $data){
if( isset($attachToAdminMail[$data[_FF_DATA_NAME]]) ){
$testEx = explode("\n", trim($data[_FF_DATA_VALUE]));
$cntTestEx = count($testEx);
if($cntTestEx > 1){
for($ex = 0; $ex < $cntTestEx; $ex++){
if(!is_array($attachment) && $attachment != ''){
$attachment = array_merge(array(trim($testEx[$ex])), array($attachment));
} else if(is_array($attachment)){
$attachment = array_merge(array(trim($testEx[$ex])), $attachment);
}else {
$attachment = trim($testEx[$ex]);
}
}
} else {
if(!is_array($attachment) && $attachment != ''){
$attachment = array_merge(array(trim($data[_FF_DATA_VALUE])), array($attachment));
} else if(is_array($attachment)){
$attachment = array_merge(array(trim($data[_FF_DATA_VALUE])), $attachment);
}else {
$attachment = trim($data[_FF_DATA_VALUE]);
}
}
}
}
}
foreach ($this->maildata as $data) {
if( $data[_FF_DATA_NAME] == 'upload' )
{
$body .= $data[_FF_DATA_TITLE].': http://www.next4dev.com/clientes/p3image/components/com_facileforms/uploads' . basename($data[_FF_DATA_VALUE]);
} else {
$body .= $data[_FF_DATA_TITLE].": ".$data[_FF_DATA_VALUE].nl() . "\r\n";
}
}
$this->sendMail($from, $fromname, $recipient, $subject, $body, $attachment); // This line actually emails the form.
I also need to send multiple emails as selected in the tag <select>
need to know how to do this process?
How to identify the select variable? and their contents?
tipe:
if(select == 'administrator')
$this->sendMail($from, $fromname, 'andre@next4.com.br', $subject, $body, $attachment);
else if(select == 'comercial')
$this->sendMail($from, $fromname, 'comercial@next4.com.br', $subject, $body, $attachment);