Welcome Guest, Not a member yet? Register   Sign In
Is CodeIgniter really broken??
#1

[eluser]Total Shop UK[/eluser]
Below has been copied from my post on the Mercury SMTP forum.

I have a problem sending a test mail using the PHP CodeIgniter Framework.. Any ideas?
Code:
HELO localhost
MAIL FROM:<"Some Name" <[email protected]>>
RCPT TO:<[email protected]>
DATA
DATA - 16 lines, 517 bytes.
QUIT
Code:
$this->load->library('email');
$this->email->from('[email protected]', 'Some Name');
$this->email->to('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();

Code:
Your message has been successfully sent using the following protocol: mail

From: "Some Name"
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
=?utf-8?Q?Email_Test?=
Testing the email class.

Code:
05 May 10 13:43, Servicing job MO000002... 553 5.0.0 < <[email protected]> SIZE=738... Unbalanced '<'
[Failed].

First Reply

Yes, the mailer is broken. The MAIL FROM: e-mail address is supposed to be a simple SMTP e-mail address enclosed in <> without the Personal name part. This gets removed in the receiving process but the leading "<" does not and so you have an unbalanced address. Then the mail is forwarded on to the outside world this unbalanced address is refused. You need to fix your PHP program to only use the e-mail address in the MAIL FROM: string.

FWIW, it looks like your mailer application is using the From: field entry for both the From: and MAIL FROM:, this needs to be fixed.

Second Reply

The mailer script seems rather broken. In addition to what Thomas has already said the header name for the Subject header is missing, as well as the required blank line between headers and message body.

http://community.pmail.com/forums/thread/23242.aspx
#2

[eluser]WanWizard[/eluser]
I can't reproduce this issue, and looking at the code I don't see where a MAIL FROM could be created that still contains the personal name part.

Which version of CI are you using?
#3

[eluser]Total Shop UK[/eluser]
Latest CI v1.7.2

Fresh install adding the below to a controller

Code:
$this->load->library('email');
$this->email->from('[email protected]', 'Some Name');
$this->email->to('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();

It will work if I use sendmail but not if I use Mercury SMTP server.

http://download-us.pmail.com/m32-472.exe
#4

[eluser]Total Shop UK[/eluser]
Does anyone know how I could achieve a valid email as shown below?

Code:
HELO localhost
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
From: "Some Name" <[email protected]>
...
#5

[eluser]ram4nd[/eluser]
I had once a problem with setting up the mail. It was because of my port number. Maybe you have a port problem as well.
#6

[eluser]Total Shop UK[/eluser]
Nice idea but if that was the case it wouldn't connect to the local SMTP relay server which it does




Theme © iAndrew 2016 - Forum software by © MyBB