• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
email->send() returns incorectly

[eluser]Dan Bowling[/eluser]
I'm getting a bad return on my send() function of the email helper.
$alumni = $this->alumni_model->get_alumni_in_region_by_city($region, $city);
                    foreach ($alumni as $alumnus)
                        $this->email->from($this->session->userdata('user_email'), $this->session->userdata('user_name'));
                        echo "<li>$alumnus->alumni_email ($alumnus->alumni_city)...";
                            echo "<span class='good'>SENT</span></li>";
                            echo "<span class='bad'>FAILED</span></li>";

When that evaluates, the page outputs failed, even though I get the email.

I'm using XAMPP with a remote SMTP gateway.

Any ideas?

[eluser]Derek Allard[/eluser]
can you work through the email lib to figure out where its dying?

[eluser]Derek Jones[/eluser]
Also what is output by $this->email->print_debugger()?

I had a similar problem on our Intranet and this is how I got it to work.

First I used the sendmail replacement from glob.com.au.

placing the sendmail.exe in C:/wamp/bin/sendmail

And configured the sendmail.ini

Then I set this in my php.

$config_mail['protocol'] = 'sendmail';
$config_mail['mailpath'] = 'C:/wamp/bin/sendmail/sendmail -t';
$config_mail['smtp_port'] = '25';

And made sure port 25 was open on the Intranet Server

And it worked like a charm.
I was very surprised it wasn't harder!

[eluser]Dan Bowling[/eluser]
I've enabled email debugging, and I get the following message: Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Here's the full details:

220 xxx.xxx.xxx ESMTP Sendmail Switch-3.3.1/Switch-3.3.1; Wed, 10 Sep 2008 12:33:18 -0600 (MDT)
hello: 250-cug2.umt.edu Hello mymachine.gs.umt.edu [xx.x.xxx.xxx], pleased to meet you
250-SIZE 31457280
250 HELP
from: 250 2.1.0 ... Sender ok
to: 250 2.1.5 ... Recipient ok
data: 354 Please start mail input.

The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Wed, 10 Sep 2008 12:33:18 -0600
From: "Dan Bowling"
To: [email protected]
Subject: s
Reply-To: "daniel.bo[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


I'll try to go through the library and determine what specifically is causing it later tonight.

I'm using an external SMTP server, so I shouldn't have to set up sendmail locally, right? Otherwise my email wouldn't be going out at all (which it is.) I've verified that my php.ini settings are correct (and since I'm using XAMPP, I've checked to make sure it is right in the php and apache folder, since it might be using either one.)

[eluser]Derek Jones[/eluser]
Are you on Windows, dbowling? IIRC, you'll have to manually set the sendmail_from address in your php.ini for SMTP in that environment for a valid Return-Path Sender address.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.