Cakephp Error Socketexception Could Not Send Email
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn cakephp mail socketexception more about Stack Overflow the company Business Learn more about hiring developers or posting cakephp socketexception invalid email ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up cake php email helper - internal error up vote 0 down vote favorite I am trying to send email with cake php email component: var $components = array('Email'); $email = new CakeEmail(); $email->from(array('me@example.com' => 'My Site')); $email->to('xxx@gmail.com'); $email->subject('About'); $email->send('My message'); And I always get message: Couldnt send email. Internal error occured. In error log there is "SocketException". I am using cakephp 2.0. How should I configure things to get it work? I don't want to use any smtp servers and so on, I just want to send simple email. I am using WAMP on my PC. cakephp cakephp-2.0 share|improve this question asked May 7 '12 at 18:33 user606521 2,70853579 Can you send email from a simple php script (without any CakePHP being involved)? –Annabel May 7 '12 at 20:53 1 why are you including a component when you are ending up using the lib instead? also - using windows and NOT using smtp is a pretty difficult thing to set up if you don't know what to do. why not just using the the easy way (smtp is only 4 config strings). –mark May 7 '12 at 22:00 look at my answer here stackoverflow.com/questions/17669012/… –Fury Nov 9 '13 at 10:57 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote Uncomment the line: extension=php_openssl.dll in php.ini. This will resolve your Socket problem. One more thing I want to say is : You are mixing two thing core library & component both. FYI EmailComponent is now deprecated. so use core library instead. for more details check this link http://book.cakephp.org/2.0/en/core-utility-libraries/email.html share|improve this answer answered Jul 7 '12 at 13:38 anasanjaria 8131017 add a comment| up v
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, http://stackoverflow.com/questions/10487203/cake-php-email-helper-internal-error helping each other. Join them; it only takes a minute: Sign up cakephp 2 CakeEmail Could not send email error up vote 0 down vote favorite I am trying to get CakeEmail working and I am getting a "Could not send email" Internal Error. The last line of the stack trace is CORE/Cake/Network/Email/MailTransport.php line 47 -> MailTransport->_mail(string,string,string,string,null) In http://stackoverflow.com/questions/17669012/cakephp-2-cakeemail-could-not-send-email-error my email.php config I have class EmailConfig { public $default = array( 'transport' => 'Mail', 'from' => 'no-reply@xxxxx.com.au' ); } I receive my email address from a form and am trying to send an email to the subscriber. My code is as follows $email_addr = $subs_data['Subscriber']['subscriber']; $Email = new CakeEmail('default'); $Email->emailFormat('html') ->template('welcome') ->to($email_addr) ->subject('New Subscription') ->send(); I have done some testing and the value in $email_addr is exactly what is coming from the form and is a valid Email address. I have a template in View/Emails/html/welcome.ctp that for now is just a very basic message Looking at the stack trace and line 47 in MailTransport.php I have found the error appears to be to do with the "to" email address. I can not see what is wrong with it though. I have looked at a lot of examples and as far as I can tell I am not doing anything wrong. I would appreciate any help so I could get this application finished. Kind Regards Richard php email cakephp share|improv
Support Search GitHub This repository Watch 57 Star 347 Fork 222 CakeDC/users Code Issues 18 Pull requests 1 https://github.com/CakeDC/users/issues/54 Projects 0 Pulse Graphs New issue Email doesn't work #54 Closed https://groups.google.com/d/topic/cake-php/ZnaI0oVb_NE alscheuring opened this Issue Apr 4, 2012 · 11 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 3 participants alscheuring commented Apr 4, 2012 I'm positive this isn't a problem with your plugin but with my understanding of cakephp error the new CakeEmail component and Cakephp 2.1.1, but hopefully you could give me a clue. I've got a fresh cakephp 2.1.1 installation and your plugin installed. I can add users and view them etc. When I go to do anything that handles email I get an Internal Error. The sendVerificationEmail array appears to be empty if cakephp error socketexception that matters. The only thing I've done to the cake installation that's not in your plugin instructions is to rename email.php.default to email.php and put in my institutions smtp relay information (under $smtp). All plugins are set to load in bootstrap.php. Any suggestions? burzum commented Apr 4, 2012 Anything in the log files? error.log? meotimdihia commented Apr 4, 2012 I am using plugin this and cakephp 2.1.1, and no problem with send email. alscheuring commented Apr 4, 2012 I'll check it out and get back to you. Which config in the email.php does it use? The default? alscheuring commented Apr 4, 2012 Here's the error from the error log: 2012-04-04 18:54:43 Error: [SocketException] Could not send email. #0 /var/www/localepons2/lib/Cake/Network/Email/CakeEmail.php(972): MailTransport->send(Object(CakeEmail)) #1 /var/www/localepons2/app/Plugin/Users/Controller/UsersController.php(580): CakeEmail->send() #2 /var/www/localepons2/app/Plugin/Users/Controller/UsersController.php(320): UsersController->_sendVerificationEmail(Array) #3 [internal function]: UsersController->add() #4 /var/www/localepons2/lib/Cake/Controller/Controller.php(485): ReflectionMethod->invokeArgs(Object(UsersController), Array) #5 /var/www/localepons2/lib/Cake/Routing/Dispatcher.php(103): Controller->invokeAction(Object(CakeRequest)) #6 /var/www/localepons2/lib/Cake/Routing/Dispatcher.php(85): Dispatcher->_invoke(Object(UsersController), Object(CakeRequest), Object(CakeResponse)) #7 /var/www/localepons2/app/webroot/index.php(96): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse)) #8 {main} meotimdihia commented Apr 5, 2012 I don't sure plugin can send email when don't set config .
from GoogleSign inHidden fieldsSearch for groups or messages