CodeIgniter Forums
Email mail() problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Email mail() problem (/thread-6919.html)



Email mail() problem - El Forum - 03-17-2008

[eluser]Kemik[/eluser]
Quote:Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

From: "CI Base"
Return-Path:
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
Activate your account - CI Base
Hello User,

rest of message

My host (resellerzoom) have no idea why CI says mail() isn't working. So I thought I'd best try here.

Code:
$this->load->library('email');

        $this->email->from('[email protected]', 'CI Base');
        $this->email->to($email);
        
        $this->email->subject('Activate your account - CI Base');
        $this->email->message($message);
        
        $this->email->send();
        
        echo $this->email->print_debugger();

sendmail gives an internal server error.


Email mail() problem - El Forum - 03-17-2008

[eluser]Derek Allard[/eluser]
How do you send mail from PHP outside of CodeIgniter?


Email mail() problem - El Forum - 04-18-2008

[eluser]woodydude[/eluser]
I'm having a similar problem to be honest...

I can send an email using the following code:
Code:
mail("[email protected]", "Email Subject", "Message content", "From: [email protected]" );

however I'd prefer to use the CI emailing, but using the following code it's not working:
Code:
$this->load->library('email');

$this->email->from('[email protected]');
$this->email->to('[email protected]');
$this->email->subject('Contact Form');
        
$msg = 'This is my message content';
$this->email->message($msg);
        
$this->email->send();
The result of:
Code:
print $this->email->print_debugger();
I get:
Quote:Unable to open a socket to Sendmail. Please check settings.
Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Fri, 18 Apr 2008 14:33:51 +0100
From:
Return-Path:
To: [email protected]
Subject: Contact Form
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

Any ideas?
Cheers Woody


Email mail() problem - El Forum - 05-10-2008

[eluser]tomodian[/eluser]
I had same problem, and in my case, mailserver was unable to send mail when From: and Return-Path is blank.
Try setting both From and Return-Path to check in your environment.


Email mail() problem - El Forum - 06-27-2008

[eluser]druid100[/eluser]
i have the same problem, neither in From: nor in Return-Path: is the email address specified which i set with emai->from(...).

any ideas why that could happen?


Email mail() problem - El Forum - 06-27-2008

[eluser]druid100[/eluser]
hmm ... actually if you log the debug output to a file you probably will see that data is not blank, i made the same mistake to just echo it to the browser, so everything between < and > is not shown properly.


Email mail() problem - El Forum - 08-13-2008

[eluser]Peri[/eluser]
The trouble is in restrict functions php. Probably your hosted disabled functios like popen for example.