Welcome Guest, Not a member yet? Register   Sign In
[solved] Email Class - sending email twice (unwanted)


i have a problem with the Email Class.
I simply want to send an email to a client.
Here is my code:
$config['wordwrap'] = TRUE;

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


echo $this->email->print_debugger();

This works fine at localhost.
But on my server it sends the Email to the [email protected] AND to me ([email protected]). I don't know why I also get the email.

If I use php mail() function it doesn't send the email twice. So it has to do something with Codeigniter Email-Class.

I would appreciate help.

$config['protocol'] = "sendmail";
there is only one email sending. But this one arrives at the FROM-adress and not at the clients adress.

Is there maybe a problem with my servers settings? When yes, why php mail() function is working ?


Maybe the that the sender receives is an email sending failed message, which first, the message is sent back and then a big footer which tells you that the email you provided does not exist or is invalid

I also thought that this might be the problem.
But I tested it with 2 valid emails of myself. The message is not sent back, it just arrives at the from-adress and the to-adress without an error.
The email-class debugger shows no error.

I use a third party script such as PHPMailer and SwiftMail so I haven't experience this bug or situation.
The first thing that came to my mind is that, maybe you should re-initialize the email class especially when using a loop, to cleanup unnecesary data. But then I read again and saw that your problem is that the sender is also sent the message.

I also tried to use this:

but it didnt help.. well there is no reason at all that the sender gets an email.
Guess I have to use SwiftMail or another 3rd party script.

Thanks anyway

Okay i solved it with the 3rd party script SwiftMailer.


Theme © iAndrew 2016 - Forum software by © MyBB