Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][CakePHP] Wysyłanie emaila z załącznikiem, Nie załancza załacznika
fenix.robi
post
Post #1





Grupa: Zarejestrowani
Postów: 97
Pomógł: 7
Dołączył: 24.06.2008

Ostrzeżenie: (0%)
-----


Witam, mam problem z dodaniem załacznika do Emaila, i już nie weim czy to jakaś literówka czy czegoś nie dodałem, dodam że adres bezwzględny do załacznika poprawny

  1.  
  2. $this->Email->smtpOptions = array(
  3.     'port'=> '25', 
  4.     'timeout'=>'30',
  5.     'host' => 'host',
  6.     'username'=>'Uname',
  7.     'password'=>'pass'
  8.  
  9. );
  10.   /* Set delivery method */
  11.  
  12. $this->Email->delivery = 'smtp';
  13.   /* Do not pass any args to send() */
  14.  
  15. $this->Email->to = $emailDo;
  16.  
  17. $this->Email->subject = $temat;
  18.  
  19. $this->Email->from = $emailOd;
  20.  
  21. $this->Email->template = 'test';
  22.  
  23. $this->Email->sendAs = 'text';
  24.  
  25. $this->Email->attachments = array('http://'.env('SERVER_NAME').'/files/pdf/test.pdf');
  26.  
  27. $this->Email->send();
  28.  
  29. /* Check for SMTP errors. */
  30.  
  31. if(isset($this->Email->smtpError)){
  32.  
  33.      debug($this->Email->smtpError);
  34.  
  35. }
  36.  
  37.  


Po wielkich trudach znalałzem odpowiedź, jesli ktoś będzie miał podobny problem to rozwiazaniem jest dodanie filePath 

  1.  
  2. $this->Email->filePaths = array('/htdocs/'.env('SERVER_NAME').'/app/webroot');
  3.  
  4. $this->Email->attachments = array('files/pdf/test.pdf');
  5.  




Ten post edytował fenix.robi 27.11.2009, 11:43:11
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.08.2025 - 06:37