Differences

This shows you the differences between two versions of the page.

Link to this comparison view

php:mail [2006/05/17 20:06]
a created
php:mail [2009/05/25 00:34]
Line 1: Line 1:
-====== PHP mail function on *nix plaform ====== 
  
-    $mailFrom = "ValidMailbox@validdomain"; 
-    $mailTo = "ValidToAddress"; 
-    $mailSubject = "Useful Subject:  Here's my subject"; 
-      
-    $mailSignature = "\n\n--\n"; 
-    $mailSignature .= "Your friendly Neighborhood web application.\n"; 
-    $mailSignature .= "For help and other information, see http://yourwebapp/help\n"; 
-     
-    $mailBody ="blahblahblah\n"; 
-    $mailBody .= $mailSignature; 
-     
-    $mailHeader  = 'From: "'.$mailFrom.'" '."\r\n"; 
-    $mailHeader .= "Reply-To: $mailFrom\r\n"; 
-    $mailHeader .= "X-Mailer: ".MYSITE."\r\n";     
-    $mailHeader .= "X-Sender-IP: {$_SERVER['REMOTE_ADDR']}\r\n"; 
-    $mailHeader .= "Bcc: ".MONITORADDRESS."\r\n";  
-     
-    $mailParams = "-f$mailFrom"; 
-    $mailResult = mail($mailTo,$mailSubject,$mailBody,$mailHeader,$mailParams); 
- 
- 
-Be awere of this ''$mailParams = "-f$mailFrom";'' 
- 
-in ''php.ini'' there is **''sendmail_path''** with default settings (for *nix): ''sendmail -t -i'' 
- 
-read more at [[http://it.extension.org/wiki/Best_Practices_Using_the_PHP_mail_Function]] 
php/mail.txt ยท Last modified: 2009/05/25 00:34 (external edit)
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready