Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
494
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. public function executeSendemail(sfWebRequest $request){
  2. $email = $this->getUser()->getAttribute('email', 'nomail..');
  3. $message = $this->getUser()->getAttribute('message', '...probably someone bypassed our contact form from IP:'.$_SERVER['REMOTE_ADDR']);
  4. $webmasteremail = sfConfig::get('app_mail_webmasteremail');
  5. $owneremail = sfConfig::get('app_mail_owneremail');
  6. $from = $email;
  7. $to = array(
  8. 'fl@yahoo.com' => 'WebMaster2',
  9. $webmasteremail => 'WebMaster1',
  10. 'office@fo' => 'WebMaster3'
  11. );
  12. $subject = 'Mesaj de la '.$this->email;
  13. $body = '
  14. Mesajul meu : '.$this->message.'
  15. Scris de : '.$this->email.'
  16.  
  17. Af WebSite.
  18. *** ai probleme cu site-ul? scrie-mi: '.$this->webmasteremail.' ***
  19. ';
  20. try
  21. {
  22. $message = $this->getMailer()->compose(
  23. array(
  24. $from,
  25. $to,
  26. $subject,
  27. $body
  28. )
  29. );
  30. $this->getMailer()->send($message);
  31. $this->getUser()->setFlash('notice', 'Mesaj trimis! MULTUMIM ! Trimite un nou mesaj.');
  32. } catch (Exception $e) {
  33. echo $e; die;
  34. $this->getUser()->setFlash('notice', 'Eroare trimitere mesaj !');
  35. }
  36. $this->redirect('contact/index');
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement