18.118.0.240 |    

Navigation

Google Advertisement

sendmail.php
  1. <?php
  2. // ****************************************************************
  3. // Variablen setzen...
  4.  
  5. $cfg=array();
  6.  
  7. // sender name...
  8. $cfg['tname'] = 'Hans Wurst';
  9.  
  10. // sender mail address...
  11. $cfg['tmail'] = 'hwurst@test.de';
  12.  
  13. // recipient name...
  14. $cfg['fname'] = 'Kloeten Benno';
  15.  
  16. // recipient mail address...
  17. $cfg['fmail'] = 'kbenno@foo.bar';
  18.  
  19. // subject...
  20. $cfg['subject'] = 'Testmail...';
  21.  
  22. // message...
  23. $cfg['message'] = 'Sie haben gewonnen';
  24.  
  25. // ****************************************************************
  26. // program action...
  27.  
  28. // Mail senden...
  29. sendmail();
  30.  
  31. // ****************************************************************
  32. // Email senden...
  33.  
  34. function sendmail() {
  35.  
  36. global $cfg;
  37.  
  38. $mail = popen( "/usr/sbin/sendmail -t ", 'w' );
  39.  
  40. 	fputs( $mail, "To: ".$cfg['tname']." <".$cfg['tmail'].">\n" );
  41. 	fputs( $mail, "From: ".$cfg['fname']." <".$cfg['fmail'].">\n" );
  42. 	if ( $cfg['ccmail'] ) fputs( $mail, "CC: ".$cfg['ccmail']."\n" );
  43. 	fputs( $mail, "X-Mailer: PHP-Mailer\n" );
  44. 	fputs( $mail, "MIME-Version: 1.0\n" );
  45. 	fputs( $mail, "Content-type: text/plain; charset=utf-8\n" );
  46. 	fputs( $mail, "Subject: ".$cfg['subject']."\n\n" );
  47.  
  48. 	fputs( $mail, $cfg['message']."\n\n" );
  49.  
  50. 	// Body der Mail zusammen stellen...
  51. 	foreach ( $_POST as $name => $value ) {
  52. 		$message.="$name \t\t\t $value\n"; // Kurzform fuer Verkettung...
  53. 		// $message=htmlspecialchars($message); // HTML-Sonderzeichen maskieren...
  54. 		$message=stripslashes( $message ); // Backslashes entfernen...
  55. 	}
  56.  
  57. 	fputs( $mail, $message."\n" );
  58.  
  59. pclose( $mail );
  60.  
  61. }
  62.  
  63. // ****************************************************************
  64. // EOF
  65. ?>
Parsed in 0.011 seconds at 152.02 KB/s

Search
 
Full text search by name and content of a snippet.

User online
There are 4 users online.

Tags Cloud

Latest snippets
str2seconds
(Bash::Function)
is_integer
(Bash::Function)
file_rotate
(Bash::Function)
confirm
(Bash::Function)
is_workingtime
(Bash::Function)
last day of last month
(Bash::Snippets)
crypt_apr1_md5
(PHP::Function)
crypt_apr1_md5
(Perl::Function)
transparent
(CSS)
rfc2822Toiso8601
(PHP::Function)