Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->load->library("PhpMailerLib");
- $mail = $this->phpmailerlib->load();
- try {
- $emails = 'comercial@ingeniumventures.com';
- $name = $this->input->post('name');
- $email = $this->input->post('email');
- $phone = $this->input->post('phone');
- $msg = $this->input->post('text');
- $mensaje = 'Se ha recibido un nuevo mensaje de:
- Nombre: '.$name.'
- Email: '.$email.'
- Tlfn: '.$phone.'
- Mensaje: '.$msg;
- //Server settings
- $mail->SMTPDebug = 2; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.ingeniumventures.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'contacto@ingeniumventures.com'; // SMTP username
- $mail->Password = 'Pllbn8ch'; // SMTP password
- $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- //Recipients
- $mail->setFrom('contacto@ingeniumventures.com', 'Ingenium ventures');
- $mail->addAddress('contacto@ingeniumventures.com', 'Ingenium ventures'); // Add a recipient
- //$mail->addCC('cc@example.com');
- //$mail->addBCC('bcc@example.com');
- //Attachments
- //$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
- //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
- //Content
- $mail->isHTML(true); // Set email format to HTML
- $mail->Subject = 'Contacto desde la web';
- $mail->Body = $mensaje;
- $mail->send();
- echo 'Message has been sent';
- } catch (Exception $e) {
- echo 'Message could not be sent.';
- echo 'Mailer Error: ' . $mail->ErrorInfo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement