Thank you Marc, I'll give a try. I cannot use SMTP because my hosting provider rejects it, so the only way is to send with php mail() function
On Jul 3, 11:12 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > hey, > $method is for ex. 'smtp' sosendcalls __smtp function. > Can't help you with the quotes but ive built a littlecomponentthat > uses swiftmailer library and - its a drop in replacement - you use can > use it the same like the built in one. > It needs just a tiny bit of code in your AppController::beforeFilter > and it should work(you also need SwiftMailer library in your vendors > dir if you will download thecomponentfrom 'files' section instead of > usingGIT). > if you have time - try it > ;)http://www.assembla.com/wiki/show/swift_email_component > > HTH, > > On Thu, Jul 3, 2008 at 6:09 AM, senser <[EMAIL PROTECTED]> wrote: > > > No success :( > > > I tried to put quotes but didn't help: > > $this->Email->replyTo='"'.$this->data['Question']['name'].'" <'.$this- > >>data['Question']['email'].'>'; > > $this->Email->from='"'.$this->data['Question']['name'].'" <'.$this- > >>data['Question']['email'].'>'; > > > I read the source ofemailcomponenttrying to figure the problem but > > there's a little portion I can't understand - function "send" > > returns this "return $this->$__method();". > > > I would appreciate any directions and suggestions. > > > Thanks! > > > On Jul 3, 2:08 am, lmuszkie <[EMAIL PROTECTED]> wrote: > >> Jonah: > > >> Try putting your name in quotes: > > >> $this->Email->from = '"No Reply" <noreply@'.env('HTTP_HOST').'>'; > > >> -luke > > >> On Jul 2, 1:13 pm, senser <[EMAIL PROTECTED]> wrote: > > >> > Hello, > > >> > I have similar problem withemailcomponent- php mail function works > >> > fine but Cake can'tsendemailthrough built-incomponent. > >> > Here is debug output:: > > >> > To: [EMAIL PROTECTED] > >> > From: [EMAIL PROTECTED] > >> > Subject: Query from website > >> > Header: > > >> > From: [EMAIL PROTECTED] > >> > Reply-To: [EMAIL PROTECTED] > >> > X-Mailer: CakePHPEmailComponent > >> > Content-Type: multipart/alternative; boundary="alt-" > > >> > Content-Transfer-Encoding: 7bitParameters: > > >> > Message: > > >> > --alt- > >> > Content-Type: text/plain; charset=utf-8 > >> > Content-Transfer-Encoding: 7bit > > >> > Query from > >> >Email > >> > Phone > > >> > Query > > >> > --alt- > >> > Content-Type: text/html; charset=utf-8 > >> > Content-Transfer-Encoding: 7bit > > >> > Query from > >> >Email: > >> > Phone > > >> > Query > >> > --alt--- > > >> > And here is the content of my controller: > > >> > functionsend($id=null){ > > >> > $this->layout='small'; > > >> > if(!empty($this->data['Question'])){ > >> > $this->Question->set($this->data['Question']); > >> > if($this->Question->validates()){ > >> > > >> > if(!empty($this->data['Question']['id'])){ > >> > > >> > $this->Question->bindModel(array('belongsTo'=>array('Offer'))); > >> > > >> > $this->Question->Offer->set('id', $this->data['Question']['id']); > >> > > >> > if($this->Question->Offer->exists()){ > >> > > >> > $this->data['Question']['about']=$id; > >> > } > >> > else{ > >> > > >> > unset($this->data['Question']['about']); > >> > } > >> > } > > >> > $this->Email->to='[EMAIL PROTECTED]'; > >> > > >> > $this->Email->replyTo=$this->data['Question']['email']; > >> > > >> > $this->Email->from=$this->data['Question']['email']; > >> > $this->Email->subject='Query from > >> > website'; > >> > $this->Email->sendAs='both'; > >> > $this->Email->template='default'; > >> > $this->Email->layout='default'; > >> > $this->Email->delivery='mail'; > >> > $this->set('Question', > >> > $this->data['Question']); > > >> > if($this->Email->send()){ > >> > > >> > $this->Session->setFlash(__('Successful_query', true)); > >> > $this->render('/questions/send', > >> > 'small'); > >> > } > >> > else{ > >> > > >> > $this->Session->setFlash(__('Email_problem', true)); > >> > $this->render('/questions/send', > >> > 'small'); > >> > } > > >> > } > >> > else{ > >> > $this->render('/questions/send', > >> > 'small'); > >> > } > >> > } > >> > else{ > >> > $this->data['Question']['about']=$id; > >> > $this->render('/questions/send', 'small'); > >> > } > > >> > } > > >> > Any suggestions ??? > > >> > On Jul 1, 1:16 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > > >> > > Ok, thanks for the help. I'm not sure yet if I am going to switch or > >> > > not yet, as it does work kinda, just not all the way. Probably will > >> > > later actually > > >> > > Thanks, > >> > > Jonah > > >> > > On Jun 30, 3:07 pm, r0mk1n <[EMAIL PROTECTED]> wrote: > > >> > > > no, you can use it anywhere you want ( with correct options of > >> > > > course ) > > >> > > > On Jul 1, 1:03 am, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > > >> > > > > Question, will using SMTP as you suggested still work once I > >> > > > > upload it > >> > > > > to dreamhost? > > >> > > > > On Jun 30, 3:00 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> wrote: > > >> > > > > > I can use mail() with localhost. I set up the php.ini to do it > >> > > > > > and it > >> > > > > > works fine. I also got it to work with theemailcomponent, but > >> > > > > > only > >> > > > > > if I don't contain < or > characters, that is my problem. > > >> > > > > > On Jun 30, 2:55 pm, r0mk1n <[EMAIL PROTECTED]> wrote: > > >> > > > > > > this string "$this->smtpOptions ..... " must be: > >> > > > > > > $this->Email->smtpOptions = array( 'port'=> 25, 'host' => > >> > > > > > > 'yourSMTPServer', 'username'=>'yourUserName', > >> > > > > > > 'password'=>'yourSMTPPassword', 'timeout' => 30 ); > > >> > > > > > > Sorry :( > > >> > > > > > > On Jul 1, 12:53 am, r0mk1n <[EMAIL PROTECTED]> wrote: > > >> > > > > > > > you are trying tosendvia PHPs mail function ( default method > >> > > > > > > > in > >> > > > > > > >Emailcomponent ), but you can`t do it from localhost ;) > >> > > > > > > > better way -sendvia SMTP > > >> > > > > > > > 1. you need to setup smtp delivery: > > >> > > > > > > > $this->Email->delivery = 'smtp'; > > >> > > > > > > > 2. setup SMTP params: > > >> > > > > > > > $this->smtpOptions = array( 'port'=> 25, 'host' => > >> > > > > > > > 'yourSMTPServer', > >> > > > > > > > 'username'=>'yourUserName', 'password'=>'yourSMTPPassword', > >> > > > > > > > 'timeout' > >> > > > > > > > => 30 ); > > >> > > > > > > > 3. Sending .... ;) > > >> > > > > > > > To get SMTP settings you need to getemailrelay information > >> > > > > > > > from your > >> > > > > > > > hosting support (server, username and password) > > >> > > > > > > > P.S. with standartcomponentyou can`tsendyour emails via relay > >> > > > > > > > servers that using TLS or SSL connections ( like gmail.com > >> > > > > > > > ), to do > >> > > > > > > > this you need using some like ShiftMailer > > >> > > > > > > > On Jun 30, 11:14 pm, "Turnquist, Jonah" <[EMAIL PROTECTED]> > >> > > > > > > > wrote: > > >> > > > > > > > > Update: I figured out I can get it to work if I remove > >> > > > > > > > > all < and > > > >> > > > > > > > > $this->Email->from = 'No Reply > >> > > > > > > > > <noreply@'.env('HTTP_HOST').'>'; > >> > > > > > > > > $this->Email->replyTo = No Reply > >> > > > > > > > > '<noreply@'.env('HTTP_HOST').'>'; > >> > > > > > > > > $this->Email->return = No Reply > >> > > > > > > > > '<noreply@'.env('HTTP_HOST').'>'; > > >> > > > > > > > > changed to this: > > >> > > > > > > > > $this->Email->from = 'noreply@'.env('HTTP_HOST'); > >> > > > > > > > > $this->Email->replyTo = 'noreply@'.env('HTTP_HOST'); > >> > > > > > > > > $this->Email->return = 'noreply@'.env('HTTP_HOST'); > > >> > > > > > > > > Now it works, but of course now I can't supply a name. Is > >> > > > > > > > > there a > >> > > > > > > > > better solution? > > >> > > > > > > > > On Jun 30, 12:09 am, "Turnquist, Jonah" <[EMAIL > >> > > > > > > > > PROTECTED]> wrote: > > >> > > > > > > > > > Ok, I went through theemailcomponent code and removed > >> > > > > > > > > > the '@' sign > >> > > > > > > > > > from the mail function to show error messages, and so > >> > > > > > > > > > now it gives > >> > > > > > > > > > this error: > > >> > > > > > > > > > Warning (2): mail() [function.mail]: SMTP server > >> > > > > > > > > > response: 550 5.1.0 > >> > > > > > > > > > <=?UTF-8?B??= <[EMAIL PROTECTED]>> '@' or '.' expected > >> > > > > > > > > > after '=?UTF-8? > >> > > > > > > > > > B??=' [CORE\cake\libs\controller\components\email.php, > >> > > > > > > > > > line 667] > > >> > > > > > > > > > And this is what it ran (I put a little echo in it to > >> > > > > > > > > > see what it was > >> > > > > > > > > > putting into the mail() function) to get the error: > >> > > > > > > > > > mail(poppitypopATgmailDOTcom, =?UTF-8?B? > >> > > > > > > > > > V2VsY29tZSB0byBvdXIgcmVhbGx5IGNvb2wgdGhpbmc=?=, content > >> > > > > > > > > > stuff here , > >> > > > > > > > > > From: =?UTF-8?B??= Reply-To: =?UTF-8?B??= Return-Path: > >> > > > > > > > > > =?UTF-8?B??= X- > >> > > > > > > > > > Mailer: CakePHPEmailComponent Content-Type: text/plain; > >> > > > > > > > > > charset=UTF-8 Content-Transfer-Encoding: 7bit, )' > > >> > > > > > > > > > So I conclude the problem is the ?UTF-8?B??. Which is > >> > > > > > > > > > probably > >> > > > > > > > > > something I can not fix myself. This is a bug. Could > >> > > > > > > > > > someone make a > >> > > > > > > > > > ticket for this? hehe, I really have no idea how to use > >> > > > > > > > > > trac, > >> > > > > > > > > > otherwise I would do it myself... > > >> > > > > > > > > > On Jun 28, 5:11 am, "b logica" <[EMAIL PROTECTED]> wrote: > > >> > > > > > > > > > > Note the "=?UTF-8?B??=" bits. There seems to be a lot > >> > > > > > > > > > > of that going > >> > > > > > > > > > > on. I don't know if anyone's figured out the cause yet > >> > > > > > > > > > > but I suggest > >> > > > > > > > > > > you check Trac. > > ... > > read more » --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---