![]() |
I choose SMTP, but get mail() error - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: I choose SMTP, but get mail() error (/showthread.php?tid=15853) |
I choose SMTP, but get mail() error - El Forum - 02-16-2009 [eluser]nunomira[/eluser] Hi, I have a config file for sending email, something like: Code: $config['protocol'] = 'smtp'; The thing is that I'm getting this error: Quote:RROR - 2009-02-16 23:05:12 --> Severity: Warning --> mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() C:\wamp\www\myDomain-productions\CodeIgniter_1.7.1\system\libraries\Email.php 1519 How is this? I choose SMTP, have everything configured and CI tries to use mail() ! And this was working at work. But not now, at home (different computer). I have a slight idea that I've had this problem in the past... and that it related to having AVG installed... but I'm not realy sure. Can AVG block CI's SMTP connection and CI defaults to mail() ? Does this make sense? I choose SMTP, but get mail() error - El Forum - 02-17-2009 [eluser]Kyle Short[/eluser] Not a lot of info to go on...do you have an SMTP server running on localhost? What do your email config settings look like? I choose SMTP, but get mail() error - El Forum - 02-17-2009 [eluser]brianw1975[/eluser] was just working on a server that used smtp just the other day. if your mail server is on the same machine try changing mail.myDomain.com to localhost or 127.0.0.1 fixed their junk up real quick. your sys-admin you should contact for the answer you seek, young padawan. mmm yes. sorry, had to for some reason.... ps my client had a windows server I choose SMTP, but get mail() error - El Forum - 02-17-2009 [eluser]nunomira[/eluser] Hi, The SMTP server is not local, it's on a server on the web. It's a real domain. Not exactly myDomain.com, but something like that. The config settings are exactly the ones above, although these ones are dummy data). I choose SMTP, but get mail() error - El Forum - 02-17-2009 [eluser]Kyle Short[/eluser] Hmm, your error states that it is trying to connect to an SMTP on local host. Do you have your config settings in an email.cfg file (not normal config file)? You may want to set a port too...possibly 587 I choose SMTP, but get mail() error - El Forum - 02-17-2009 [eluser]nunomira[/eluser] Hi, Yes, the config file is just fine. I'm sure of this, because I've used it in the past, and exactly the same site which I'm working on, was working fine when I was at work. Now I'm at home. Different computer... same code... and not working. I choose SMTP, but get mail() error - El Forum - 04-06-2009 [eluser]Pinguis[/eluser] Hi, i had the same problem and solved it by adding this line Code: ini_set('SMTP', 'your.smtp.server'); Its likely a CI bug, i suppose? I choose SMTP, but get mail() error - El Forum - 11-01-2009 [eluser]bikuta[/eluser] [quote author="Pinguis" date="1239070609"]Hi, i had the same problem and solved it by adding this line Code: ini_set('SMTP', 'your.smtp.server'); Its likely a CI bug, i suppose?[/quote] Where did you add the line exactly? I choose SMTP, but get mail() error - El Forum - 11-01-2009 [eluser]Pinguis[/eluser] [quote author="bikuta" date="1257096065"] Where did you add the line exactly?[/quote] Put it somewhere near the mail function call. For instance, at the beginning of the controller that uses it, where you would place code to load helpers, libraries, etc. I choose SMTP, but get mail() error - El Forum - 04-04-2010 [eluser]novice32[/eluser] I have the same problem: I used to be able to send emails, but now I get the following: Message: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() Filename: libraries/Email.php. Yet I have Code: $config['email']['smtp_host'] = 'smtp.comcast.net'; Code: ini_set('SMTP', 'smtp.comcast.net'); I'm developing on XAMPP. |