Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: PHPMailer - problem z Replyto
Forum PHP.pl > Forum > Gotowe rozwiązania
Wyrwikufel
PHPMailer konfiguracja SMTP
Formularz do rozsyłania wiadomości z informacjami "firmowymi"
User loguje się wysyła wiadomość z konta "system@mail.pl" do swoich kontaktów, kontakt dostaje mejla i w replyto ma mejla "uzytkownik1@mail.pl"

problem polega ze klient.kontakt po otrzymaniu mejla w polu replyto ma 2 adresy system@mail.pl i uzytkownik1@mail.pl a ja bym chcial tylko 1 "uzytkownik1@mail.pl" ale niestety za nic nie moge doprowadzić do takeigo stanu.

Docelowo chciałbym aby w polu replyto programu pocztowego byl tylko 1 adres email
  1. //error_reporting(E_ALL);
  2. //error_reporting(E_STRICT);
  3.  
  4. date_default_timezone_set('America/Toronto');
  5.  
  6. require_once('klasy/PHPMailer/class.phpmailer.php');
  7. //include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
  8.  
  9. $mail = new PHPMailer();
  10.  
  11. $body = file_get_contents('pliki/mejl.naglowek.html');
  12. $body .= nl2br ($_POST["kon_tresc"]);
  13. $body .= file_get_contents('pliki/mejl.stopka.html');
  14. $body = eregi_replace("[\]",'',$body);
  15.  
  16. $mail->IsSMTP(); // telling the class to use SMTP
  17. $mail->Host = "smtp.****"; // SMTP server
  18. # $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) (org 2)
  19. // 1 = errors and messages
  20. // 2 = messages only
  21. $mail->SMTPAuth = true; // enable SMTP authentication
  22. $mail->Host = "smtp.****"; // sets the SMTP server
  23. $mail->Port = 587; // set the SMTP port for the GMAIL server
  24. $mail->Username = "*******"; // SMTP account username
  25. $mail->Password = "********"; // SMTP account password
  26.  
  27. $mail->SetFrom('**@**', 'System obsługi firmy');
  28.  
  29. $mail->AddReplyTo("user@mail.pl","First Last");
  30.  
  31. $mail->Subject = $_POST["kon_temat"];
  32.  
  33. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
  34.  
  35. $mail->MsgHTML($body);
  36.  
  37. $address = $_POST["kon_odbio"];
  38. $mail->AddAddress($address, $_POST["kon_odbio"]);
  39.  
  40. # $mail->AddAttachment("pliki/logo.png"); // attachment
  41. # $mail->AddAttachment("pliki/pasek.png"); // attachment
  42.  
  43. if(!$mail->Send())
  44. {
  45. echo "Mailer Error: " . $mail->ErrorInfo;
  46. }
  47. else
  48. {
  49. unset ($_POST);
  50. # echo "Message sent!";
  51. }
wookieb
A spróbuje przed ReplyTo dodać
  1. $mail->ClearReplyTos();
Wyrwikufel
Kolego, bardzo dziękuje, teraz to jest dokładnie to o co mi chodziło.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2024 Invision Power Services, Inc.