User Tools

Site Tools


php:mail

PHP mail function

Examples

Sending 200 mails in a loop:

<?php
  # test sending 200 mails on the same time

  $mail_count = 200;
  $name = "Nik Wolfgramm";
  $recipient_email = "nik@example.com";
  $sender_email = "nik@example.com";
  $mail_body = "testing mail server prod1";
  $subject = "testing mail server prod1";
  $header = "From: ". $name . " <" . $sender_email . ">\r\n";
 
  for ($i=1; $i<=$mail_count; $i++) {
    mail($recipient_email, $subject, $mail_body."\nmail count: ".$mail_count, $header);
  }
?>
/srv/wiki.niwos.com/data/pages/php/mail.txt · Last modified: 2009/08/15 12:14 (external edit)