Welcome Guest, Not a member yet? Register   Sign In
SMTP server response: not RFC-compliant (Fixed)
#1

[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?
#2

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

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

[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.
#5

[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?
#6

[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
#7

[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]




Theme © iAndrew 2016 - Forum software by © MyBB