Community Discussions and Support
CodeIgniter Unbalanced '<'

How should I add a name to the from address?
Not sure with your application but the application should allow for a separate MAIL FROM: address and From: address
<span><span>MAIL 
<p>FROM</p></span><span>:<</span><span>"Some Name" </span><span><</span><span>donotreply</span><span>@</span><span>mydomain</span><span>.</span><span>com</span><span>>></span></span>

<span><span>MAIL 
</span></span>

FROM:<donotreply@mydomain.com>

Here's a session log showing a valid SMTP sending process.  I've highlighted the connecting string with a valid domain name and the SMTP address strings.  When your application can do this it's putting out a valid message.


Connect to 'scruznet.com', timeout 300.
15:04:13 >> 220 scruz.net ESMTP Sendmail 8.8.5/1.34 ready at Sat, 20 Jun 1998 15:04:14 -0700 (PDT)\0D\0A
15:04:13 << HELO thomas.lmms.lmco.com\0D\0A
15:04:13 >> 250 scruz.net Hello stephens.sj.scruznet.com [165.227.102.91], pleased to meet you\0D\0A
15:04:13 << MAIL FROM:<stephens@scruznet.com>\0D\0A
15:04:14 >> 250 <stephens@scruznet.com>... Sender ok\0D\0A
15:04:14 << RCPT TO:<stephens@scruznet.com>\0D\0A
15:04:14 >> 250 <stephens@scruznet.com>... Recipient ok\0D\0A
15:04:14 << DATA\0D\0A
15:04:14 >> 354 Enter mail, end with "." on a line by itself\0D\0A
15:04:14 << From: "Thomas Stephenson" <stephens@scruznet.com>\0D\0A
15:04:14 << To: stephens@scruznet.com\0D\0A
15:04:14 << Date: Sat, 20 Jun 1998 15:04:12 -0700\0D\0A
15:04:14 << MIME-Version: 1.0\0D\0A
15:04:14 << Content-type: text/plain; charset=US-ASCII\0D\0A
15:04:14 << Content-transfer-encoding: 7BIT\0D\0A
15:04:14 << Subject: test\0D\0A
15:04:14 << Priority: normal\0D\0A
15:04:14 << X-mailer: Pegasus Mail for Win32 (v3.01b)\0D\0A
15:04:14 << \0D\0A
15:04:14 << test message body\0D\0A
15:04:14 << \0D\0A
15:04:14 << .\0D\0A
15:04:15 >> 250 PAA08117 Message accepted for delivery\0D\0A
15:04:15 << QUIT\0D\0A
15:04:15 >> 221 scruz.net closing connection\0D\0A

&lt;blockquote&gt;How should I add a name to the from address?&lt;/blockquote&gt;Not sure with your application but the application should allow for a separate MAIL FROM: address and From: address &lt;blockquote&gt;&lt;code&gt;&lt;span&gt;&lt;span&gt;MAIL FROM&lt;/span&gt;&lt;span&gt;:&amp;lt;&lt;/span&gt;&lt;span&gt;&quot;Some Name&quot; &lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;donotreply&lt;/span&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;mydomain&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;com&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;code&gt;&lt;span&gt;&lt;span&gt;MAIL FROM&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span&gt;donotreply&lt;/span&gt;&lt;span&gt;@&lt;/span&gt;&lt;span&gt;mydomain&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;com&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; Here&#039;s a session log showing a valid SMTP sending process.&amp;nbsp; I&#039;ve highlighted the connecting string with a valid domain name and the SMTP address strings.&amp;nbsp; When your application can do this it&#039;s putting out a valid message. &lt;/p&gt;&lt;p&gt; Connect to &#039;scruznet.com&#039;, timeout 300. 15:04:13 &amp;gt;&amp;gt; 220 scruz.net ESMTP Sendmail 8.8.5/1.34 ready at Sat, 20 Jun 1998 15:04:14 -0700 (PDT)\0D\0A 15:04:13 &amp;lt;&amp;lt; &lt;b&gt;HELO thomas.lmms.lmco.com\0D\0A&lt;/b&gt; 15:04:13 &amp;gt;&amp;gt; 250 scruz.net Hello stephens.sj.scruznet.com [165.227.102.91], pleased to meet you\0D\0A 15:04:13 &amp;lt;&amp;lt; &lt;b&gt;MAIL FROM:&amp;lt;stephens@scruznet.com&amp;gt;&lt;/b&gt;\0D\0A 15:04:14 &amp;gt;&amp;gt; 250 &amp;lt;stephens@scruznet.com&amp;gt;... Sender ok\0D\0A 15:04:14 &amp;lt;&amp;lt; &lt;b&gt;RCPT TO:&amp;lt;stephens@scruznet.com&amp;gt;&lt;/b&gt;\0D\0A 15:04:14 &amp;gt;&amp;gt; 250 &amp;lt;stephens@scruznet.com&amp;gt;... Recipient ok\0D\0A 15:04:14 &amp;lt;&amp;lt; DATA\0D\0A 15:04:14 &amp;gt;&amp;gt; 354 Enter mail, end with &quot;.&quot; on a line by itself\0D\0A 15:04:14 &amp;lt;&amp;lt; From: &quot;Thomas Stephenson&quot; &amp;lt;stephens@scruznet.com&amp;gt;\0D\0A 15:04:14 &amp;lt;&amp;lt; To: stephens@scruznet.com\0D\0A 15:04:14 &amp;lt;&amp;lt; Date: Sat, 20 Jun 1998 15:04:12 -0700\0D\0A 15:04:14 &amp;lt;&amp;lt; MIME-Version: 1.0\0D\0A 15:04:14 &amp;lt;&amp;lt; Content-type: text/plain; charset=US-ASCII\0D\0A 15:04:14 &amp;lt;&amp;lt; Content-transfer-encoding: 7BIT\0D\0A 15:04:14 &amp;lt;&amp;lt; Subject: test\0D\0A 15:04:14 &amp;lt;&amp;lt; Priority: normal\0D\0A 15:04:14 &amp;lt;&amp;lt; X-mailer: Pegasus Mail for Win32 (v3.01b)\0D\0A 15:04:14 &amp;lt;&amp;lt; \0D\0A 15:04:14 &amp;lt;&amp;lt; test message body\0D\0A 15:04:14 &amp;lt;&amp;lt; \0D\0A 15:04:14 &amp;lt;&amp;lt; .\0D\0A 15:04:15 &amp;gt;&amp;gt; 250 PAA08117 Message accepted for delivery\0D\0A 15:04:15 &amp;lt;&amp;lt; QUIT\0D\0A 15:04:15 &amp;gt;&amp;gt; 221 scruz.net closing connection\0D\0A &lt;/p&gt;

I have a problem sending a test mail using the PHP CodeIgniter Framework.. Any ideas?

HELO localhost
MAIL FROM:<"Some Name" <donotreply@mydomain.com>>
RCPT TO:<me@live.com>
DATA
DATA - 16 lines, 517 bytes.
QUIT

$this->load->library('email');<br>

$this->email->from('donotreply@mydomain.com', 'Some Name');

$this->email->to('me@live.com');

$this->email->subject('Email Test');

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

$this->email->send();

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

Your message has been successfully sent using the following protocol:

mail

From: "Some Name" <donotreply><br>Return-Path: <donotreply><br>Reply-To: "donotreply@mydomain.com" <donotreply><br>X-Sender: donotreply@mydomain.com<br>X-Mailer: CodeIgniter<br>X-Priority: 3 (Normal)<br>Message-ID: &lt;4be167e23bc64@mydomain.com&gt;<br>Mime-Version: 1.0<br>Content-Type: text/plain; charset=utf-8<br>Content-Transfer-Encoding: 8bit<br>=?utf-8?Q?Email_Test?=<br>Testing the email class.<br></donotreply>@cambridgeguarantee.com&gt;</donotreply>@cambridgeguarantee.com&gt;</donotreply>@cambridgeguarantee.com>

05 May 10 13:43, Servicing job MO000002... 553 5.0.0 < <donotreply@mydomain.com> SIZE=738... Unbalanced '<'
[Failed].

&lt;p&gt;&lt;b&gt;I have a problem sending a test mail using the PHP CodeIgniter Framework.. Any ideas? &lt;/b&gt; &lt;/p&gt;&lt;p&gt;HELO localhost MAIL FROM:&amp;lt;&quot;Some Name&quot; &amp;lt;donotreply@mydomain.com&amp;gt;&amp;gt; RCPT TO:&amp;lt;me@live.com&amp;gt; DATA DATA - 16 lines, 517 bytes. QUIT &lt;/p&gt;&lt;p&gt;&lt;code&gt;$this-&amp;gt;load-&amp;gt;library(&#039;email&#039;); $this-&amp;gt;email-&amp;gt;from(&#039;donotreply@mydomain.com&#039;, &#039;Some Name&#039;); $this-&amp;gt;email-&amp;gt;to(&#039;me@live.com&#039;); $this-&amp;gt;email-&amp;gt;subject(&#039;Email Test&#039;); $this-&amp;gt;email-&amp;gt;message(&#039;Testing the email class.&#039;); $this-&amp;gt;email-&amp;gt;send(); echo $this-&amp;gt;email-&amp;gt;print_debugger();&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Your message has been successfully sent using the following protocol: mail &lt;/p&gt;&lt;pre&gt;From: &quot;Some Name&quot; &lt;donotreply@cambridgeguarantee.com&gt; Return-Path: &lt;donotreply@cambridgeguarantee.com&gt; Reply-To: &quot;donotreply@mydomain.com&quot; &lt;donotreply@cambridgeguarantee.com&gt; X-Sender: donotreply@mydomain.com X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: &amp;lt;4be167e23bc64@mydomain.com&amp;gt; Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit =?utf-8?Q?Email_Test?= Testing the email class. &lt;/donotreply@cambridgeguarantee.com&gt;&lt;/donotreply@cambridgeguarantee.com&gt;&lt;/donotreply@cambridgeguarantee.com&gt;&lt;/pre&gt;&lt;p&gt;05 May 10 13:43, Servicing job MO000002... 553 5.0.0 &amp;lt; &amp;lt;donotreply@mydomain.com&amp;gt; SIZE=738... &lt;b&gt;Unbalanced &#039;&amp;lt;&#039;&lt;/b&gt; [Failed]. &lt;/p&gt;

I have a problem sending a test mail using the PHP CodeIgniter

Framework.. Any ideas?

HELO localhost
MAIL

FROM:<"Some Name" <donotreply@mydomain.com>>
RCPT

TO:<me@live.com>
DATA
DATA - 16 lines, 517 bytes.
QUIT

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.

 

 

&lt;blockquote&gt;&lt;p&gt;&lt;b&gt;I have a problem sending a test mail using the PHP CodeIgniter Framework.. Any ideas? &lt;/b&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote&gt;HELO localhost MAIL FROM:&amp;lt;&quot;Some Name&quot; &amp;lt;donotreply@mydomain.com&amp;gt;&amp;gt; RCPT TO:&amp;lt;me@live.com&amp;gt; DATA DATA - 16 lines, 517 bytes. QUIT &lt;/blockquote&gt;&lt;p&gt;Yes, the mailer is broken.&amp;nbsp; The MAIL FROM: e-mail address is supposed to be a simple SMTP e-mail address enclosed in &amp;lt;&amp;gt; without the Personal name part.&amp;nbsp; This gets removed in the receiving process but the leading &quot;&amp;lt;&quot; does not and so you have an unbalanced address.&amp;nbsp; Then the mail is forwarded on to the outside world this unbalanced address is refused.&amp;nbsp; You need to fix your PHP program to only use the e-mail address in the MAIL FROM: string.&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

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.

/Rolf

 

&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;/Rolf &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;

Thanks, I have asked the guys on the CodeIgniter forum to take a look.

How should I add a name to the from address?

<span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);">MAIL FROM</span><span style="color: rgb(0, 119, 0);">:<</span><span style="color: rgb(221, 0, 0);">"Some Name" </span><span style="color: rgb(0, 119, 0);"><</span><span style="color: rgb(0, 0, 187);">donotreply</span><span style="color: rgb(0, 119, 0);">@</span><span style="color: rgb(0, 0, 187);">mydomain</span><span style="color: rgb(0, 119, 0);">.</span><span style="color: rgb(0, 0, 187);">com</span><span style="color: rgb(0, 119, 0);">>></span></span>

&lt;p&gt;Thanks, I have asked the guys on the CodeIgniter forum to take a look.&lt;/p&gt;&lt;p&gt;How should I add a name to the from address? &lt;code&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;MAIL FROM&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;:&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(221, 0, 0);&quot;&gt;&quot;Some Name&quot; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;donotreply&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;mydomain&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 187);&quot;&gt;com&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 119, 0);&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; &lt;/p&gt;
0
-1
0
This topic is closed

Related Topics

live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft