Welcome Guest, Not a member yet? Register   Sign In
Problema send mail
#1

[eluser]Alex Jurado[/eluser]
I try to use the library mail, but get this error,
Code:
Message: mail() [function.mail]: SMTP server response: 501 5.1.7 Invalid address

It means and how I can fix it?
#2

[eluser]Clooner[/eluser]
Make sure you set all the parameters like the from address. In case it still doesn't work show your code!
#3

[eluser]Alex Jurado[/eluser]
Error:
Code:
Message: mail() [function.mail]: SMTP server response: 501 5.1.7 Invalid address

Code:
Code:
$this->load->library('email');

$this->email->from('[email protected]', 'Alex');
$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();

php.ini
Code:
[mail function]
; For Win32 only.
SMTP = pod5xx1x.outlook.com
smtp_port = 587
#4

[eluser]Clooner[/eluser]
Try setting the email protocol to smtp when loading the library.
Code:
$this->load->library('email', array('protocol' => 'smtp'));
#5

[eluser]Alex Jurado[/eluser]
Now get an error,
Code:
You did not specify a SMTP hostname.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Code:
$this->load->library(
   'email',
   array(
    'protocol'  => 'smtp',
    'SMTP'      => 'pod5xxxx.outlook.com',
    'smtp_port' => 587
   )
  );
  
$this->email->from('[email protected]', 'Alex');
$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();
#6

[eluser]Clooner[/eluser]
[quote author="Alex Jurado" date="1343667320"]Now get an error,
Code:
You did not specify a SMTP hostname.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Code:
$this->load->library(
   'email',
   array(
    'protocol'  => 'smtp',
    'SMTP'      => 'pod5xxxx.outlook.com',
    'smtp_port' => 587
   )
  );
  
        $this->email->from('[email protected]', 'Alex');
        $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();

[/quote]
See the manual how to correctly configure the email library for using a smtp server. It's all there http://ellislab.com/codeigniter/user-gui...email.html




Theme © iAndrew 2016 - Forum software by © MyBB