CodeIgniter Forums
SMTP server response: not RFC-compliant (Fixed) - 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: SMTP server response: not RFC-compliant (Fixed) (/thread-1970.html)



SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-09-2007

[eluser]R. de Veen[/eluser]
In the controller:
Code:
$tobj =& get_instance();
$tobj->load->library('email');
$tobj->email->clear();
$tobj->email->from("[email protected]");
$tobj->email->to("[email protected]");
$tobj->email->subject("subject");
$tobj->email->message("message");
$tobj->email->send();
I get this error:
Code:
A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: SMTP server response: 554 5.7.1 Sender address format `<<[email protected]>>' not RFC-compliant

Filename: libraries/Email.php

Line Number: 1232
I change this in 'system/libraries/Email.php':
Code:
L 176: $this->_set_header('From', $name.' <'.$from.'>');
L 177: $this->_set_header('Return-Path', '<'.$from.'>');
To
Code:
L 176: $this->_set_header('From', $name.' '.$from);
L 177: $this->_set_header('Return-Path', $from);
But that doesn't solve the problem when i use this:
Code:
$tobj->email->from("[email protected]", "name");
Error:
Code:
Message: mail() [function.mail]: SMTP server response: 554 5.7.1 Sender address format `<"name" <[email protected]>>' not RFC-compliant

Is this a bug or am i doing something wrong?


SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-09-2007

[eluser]sophistry[/eluser]
it looks like you must have extra < and > around the email address.


SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-10-2007

[eluser]R. de Veen[/eluser]
Extra < and >, where must i put them: `<<[email protected]>>'?


SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-10-2007

[eluser]sophistry[/eluser]
sorry, i used an english idiom which made my meaning ambiguous... let me try again.

you do not need the extra < and >, you must remove them.


SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-10-2007

[eluser]R. de Veen[/eluser]
I missed the smiley...

I never put any < or > in the controller or function. Should i remove it from the Email library (system/libraries/Email.php)? Do i have a missconfiguration in my local apache server?


SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-10-2007

[eluser]sophistry[/eluser]
Hi R de V.,

The SMTP error you posted indicates that you have somehow gotten an extra set of <> around the email. The function got an email address with <> already. Make sure your email address has no extra <> when it is passed to the CI function.

[quote author="R. de Veen" date="1183996111"]I get this error:
Code:
A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: SMTP server response: 554 5.7.1 Sender address format `<<[email protected]>>' not RFC-compliant

Filename: libraries/Email.php

Line Number: 1232



SMTP server response: not RFC-compliant (Fixed) - El Forum - 07-10-2007

[eluser]R. de Veen[/eluser]
I forgot to set in the php.ini the "sendmail_from" variabele.

[mail function]
; For Win32 only.
sendmail_from = [email protected]