Email problems

[eluser]the future darlo manager[/eluser]
Hi guys, my latest problem is with sending e-mails... I've used the code from the userguide but don't appear to be getting anywhere.

//Sets up and sends the welcome email
$this->email->from('[email protected]', 'No reply at my');
$this->email->subject('Welcome to BSL 101 on-line Resource');
$this->email->message('Testing the email class.');
echo $this->email->print_debugger();

All I get is the following error.

A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address

Filename: libraries/Email.php

Line Number: 1428

I can run a normal php mail() elsewhere on my xampp windows server but not inside this controller or anywhere else inside inside this codeigniter install. Not too sure what to do at the moment.

[eluser]Tom Glover[/eluser]
Have you set the email config, in the controller you are using? you may have to use smpt locally in windows, but that should work fine on *nix.

[eluser]the future darlo manager[/eluser]
Just set up the config above the actual e-mail send out. I dived into my php.ini file to get this information as clearly it is working for my standard e-mails out side of CI. This time I get a timeout error after 60 seconds. However I'm still confused as to why it ain't working when a mail() works quite happily.

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'exchange.ca2domain.local';
$config['smtp_port'] = '25';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;

[eluser]the future darlo manager[/eluser]
Apologies, the error I'm actually getting now is...

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\learning-support\system\libraries\Email.php on line 1704

[eluser]the future darlo manager[/eluser]
Anyone any suggestions?

In your first post, you said you got this error message:

"Message: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address"

This is the response that the remote mail server gave back to your script. It's Microsoft Exchange SMTP error message telling you that the program sending the email didn't properly identify itself during the handshake (specifically, the HELO/EHLO command). If you have access to the mail server, take a look at the logs and see what it's using. It can only be "HELO" with the fully-qualified hostname and no trailing periods or spaces.

Have a look at this MS KB article for more info:

[eluser]the future darlo manager[/eluser]
Cheers for the reply, will have a look into that. I come from a shared hosting background so have never had to worry about about mail servers etc. Anyway, I've found this morning that if I strip out the mail reference in my libraries autoloader the standard php mail function works again. So at least I have a solution now. I will perverse though with the CI mail sending but its nice to know I can fall back.

Hi there,

I think I found your problem

Have a look at this line:


Shouldn't that be:




else the email address will litteraly be '$email'

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.