Witam,

Mam problem z wysyłaniem maili z oscommerce. Wysyła tylko do niektórych kont pocztowych, ale np do WP maile nie docierają. Używałem sendmaila, ale admin serwera, (netlook.pl) napisał mi, że powinienem korzystać z funkcji mail(). Wymagany format to: mail('do@kogo','temat','treść','From: od@kogo');
Rozumiem, że muszę sobie to zmienić w kodzie źródłowym, ale jeśli chodzi o php to jestem kompletnie zielony. Znalazłem fragment kodu, który jak mi się wydaje jest odpowiedzialny za wysyłanie maili, ale nie wiem jak go zmienić. Będę wdzięczny za pomoc.

  1. /**
  2.  * Sends the mail.
  3.  */
  4.  
  5. function send($to_name, $to_addr, $from_name, $from_addr, $subject = '', $headers = '') {
  6. $to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr);
  7. $from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);
  8.  
  9. if (is_string($headers)) {
  10. $headers = explode($this->lf, trim($headers));
  11. }
  12.  
  13. for ($i=0; $i<count($headers); $i++) {
  14. if (is_array($headers[$i])) {
  15. for ($j=0; $j<count($headers[$i]); $j++) {
  16. if ($headers[$i][$j] != '') {
  17. $xtra_headers[] = $headers[$i][$j];
  18. }
  19. }
  20. }
  21.  
  22. if ($headers[$i] != '') {
  23. $xtra_headers[] = $headers[$i];
  24. }
  25. }
  26.  
  27. if (!isset($xtra_headers)) {
  28. $xtra_headers = array();
  29. }
  30.  
  31. if (EMAIL_TRANSPORT == 'smtp') {
  32. return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
  33. } else {
  34. return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
  35. }
  36. }