0
does that you can explain to me how I send email from a form by the servers Ocaweb, I have a website of a client hosted in Ocaweb, but the sending form does not work using the e-their mail, I wonder if anyone has ever had a similar problem on Ocaweb using codeigniter and how you solved it.
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$config['protocol']='smtp';
$config['smtp_host']='smtp.xxx.xxx';
$config['smtp_port']='587';
$config['smtp_timeout']='60';
$config['smtp_user']='xxxxx';
$config['smtp_pass']='xxxxx';
$config['charset']='utf-8';
$config['newline']="\r\n";
$config['mailtype']="html";
$config['smtp_crypto'] = 'tls';
$nome= $this->input->post('nome', TRUE);
$empresa = $this->input->post('nome-empresa', TRUE);
$telefone = $this->input->post('telefone', TRUE);
$celular = $this->input->post('celular', TRUE);
$email = $this->input->post('email', TRUE);
$cidade = $this->input->post('cidade', TRUE);
$bairro = $this->input->post('bairro', TRUE);
$endereco = $this->input->post('endereco', TRUE);
$data['email'] = [
'nome' =>$nome,
'empresa' =>$empresa,
'telefone' =>$telefone,
'celular' =>$celular,
'cidade' => $cidade,
'bairro' => $bairro,
'endereco' => $endereco,
'email' => $email
];
$mensagem = $this->load->view('template_email/index', $data, true);
$this->email->from($email);
$this->email->to('email');
$this->email->subject('Solicitação de Visita');
$this->email->message($mensagem);
$this->email->send();
echo $this->email->print_debugger();
In localhost sends normal with other smtp servers, the settings are in config/email.php and work, except in Locaweb, how do someone know?
The error returned is this:
The following SMTP error was encountered: 450 4.7.1 : Recipient address Rejected: Access Denied Unable to send email using PHP SMTP. Your server Might not be configured to send mail using this method
Error appears?
– rray
yes The following SMTP error was encountered: 450 4.7.1 : Recipient address Rejected: Access Denied Unable to send email using PHP SMTP. Your server Might not be configured to send mail using this method.
– Aminadabe Silva