Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]jak ustawic adres zwrotny w phpmailer
Forum PHP.pl > Forum > Przedszkole
webspy
Witam,

Proszę o pomoc, jak ustawić adres zwrotny w phpmailer 5.2.2?

rozumiem żę muszę cos tu dodać?

  1. $mail->SetFrom($nadawca_mail, $nadawca);


Pozdrawiam
aras785
Witam. W przykładach pokazują to...
  1. <html>
  2. <head>
  3. <title>PHPMailer - Mail() advanced test</title>
  4. </head>
  5. <body>
  6.  
  7. <?php
  8. require_once '../class.phpmailer.php';
  9.  
  10. $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
  11.  
  12. try {
  13. $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
  14. $mail->SetFrom('name@yourdomain.com', 'First Last');
  15. $mail->AddReplyTo('name@yourdomain.com', 'First Last');
  16. $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  17. $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  18. $mail->MsgHTML(file_get_contents('contents.html'));
  19. $mail->AddAttachment('images/phpmailer.gif'); // attachment
  20. $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
  21. $mail->Send();
  22. echo "Message Sent OK</p>\n";
  23. } catch (phpmailerException $e) {
  24. echo $e->errorMessage(); //Pretty error messages from PHPMailer
  25. } catch (Exception $e) {
  26. echo $e->getMessage(); //Boring error messages from anything else!
  27. }
  28. ?>
  29. </body>
  30. </html>
webspy
Cytat(aras785 @ 19.01.2013, 16:38:22 ) *
Witam. W przykładach pokazują to...
  1. <html>
  2. <head>
  3. <title>PHPMailer - Mail() advanced test</title>
  4. </head>
  5. <body>
  6.  
  7. <?php
  8. require_once '../class.phpmailer.php';
  9.  
  10. $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
  11.  
  12. try {
  13. $mail->AddAddress('whoto@otherdomain.com', 'John Doe');
  14. $mail->SetFrom('name@yourdomain.com', 'First Last');
  15. $mail->AddReplyTo('name@yourdomain.com', 'First Last');
  16. $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  17. $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  18. $mail->MsgHTML(file_get_contents('contents.html'));
  19. $mail->AddAttachment('images/phpmailer.gif'); // attachment
  20. $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
  21. $mail->Send();
  22. echo "Message Sent OK</p>\n";
  23. } catch (phpmailerException $e) {
  24. echo $e->errorMessage(); //Pretty error messages from PHPMailer
  25. } catch (Exception $e) {
  26. echo $e->getMessage(); //Boring error messages from anything else!
  27. }
  28. ?>
  29. </body>
  30. </html>



Ok, tylko że email dochodzi i jak chce odpowiedzieć to mam dwa adresy a powinien być jeden jako nadawca a drugi jako odpisz

co tu można jeszcze zmienić aby działało prowidłowo?
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-2025 Invision Power Services, Inc.