Welcome Guest, Not a member yet? Register   Sign In
cant send email using the email class
#1

[eluser]eugenia08[/eluser]
I can´t send a mail following the user guide (ug) instructions, i did an example like the one in the ug. and it didn´t work, here is the code in my contoller:
//////////////////////////////////////////////////////////////////////////////////////////
<?php

class PruebaMail extends MY_Controller {
function PruebaMail()
{
parent::Controller();

$this->load->library('session');
}

function index()
{
$this->send_mail();
}

function send_mail()
{
$this->load->library('email');

$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');


$this->email->subject('something');
$this->email->message('Testing the email class.');

$this->email->send();

echo $this->email->print_debugger();
}
}
////////////////////////////////////////////////////////////////////////////////////////////
and i created a php file inside the config directory the file was named email.php like the ug says, and the content is:
////////////////////////////////////////////////////////
<?php

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
////////////////////////////////////////////////////////

when i run the controller in the browser this is the result:
//////////////////////////////////////////////////////////////////////////////////
Your message has been successfully sent using the following protocol: sendmail

User-Agent: CodeIgniter
Date: Wed, 12 Aug 2009 11:34:13 -0300
From: "Your Name"
Return-Path:
To: [email protected]
Subject: =?utf-8?Q?algo?=
Reply-To: "[email protected]"
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0


Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Testing the email class.
////////////////////////////////////////////////////////////////////////////////////////
but no mail is in my invoice,

can you help me?
thank u
regard
eugenia
#2

[eluser]bretticus[/eluser]
If you are trying to send this from your home computer, your ISP most likely blocks it. But it could be numerous things (like do you even have sendmail setup on that host?)
#3

[eluser]eugenia08[/eluser]
It is not from my home computer, it's from a server, i've been used the php function mail in other aplication in the same server and it works, and still works, when i try to do the same in my actual aplication (use only the mail function) didn´t work as well.
I can´t understand why the message : Your message has been successfully sent using the following protocol: sendmail, if it not work successfully,
thank u for your aswer, if u can help me a little more i will be very happy
regards!
eugenia
#4

[eluser]bretticus[/eluser]
Do you have console access to that server? Why not issue "which sendmail" form the prompt to make sure your sendmail path is correct.

I have no idea how CI validates whether the email has been sent. Look in /var/log/mail (or your equivalent) for log files that may give a clue.




Theme © iAndrew 2016 - Forum software by © MyBB