WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Sending email with random details
Categories : PHP, Email, Debugging
Boaz Yahav
Date : Mar 12th 2005
Grade : 3 of 5 (graded 1 times)
Viewed : 5394
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Boaz Yahav
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

One may think that this is a great script for flooding someone with spam but this script is actually very useful when you need to stress test a new mail server. It is important to have the ability to fill mail boxes with emails that have random subjects, names and "from" so that you can test the sorting options of the mail box. Sorting is usually a heavy task on the mail server (in exchange for example) and if you fill a mail box with thousands of random emails you cause the mail server to work hard on sorting.

<?
$OneKBText
="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 ";
$Recipient="user@domain.com";
$MailSize="1"; //in KB
$NumberOfEmails=1;

//Build Mail Body
For($i = 1 ; $i <= $MailSize ; $i++) {
   
$Text .= $OneKBText;
}
For(
$i=1 ; $i <= $NumberOfEmails ; $i++) {
   
$Title=md5(uniqid(rand()));
   
$FirstName=substr($Title,1,5);
   
$LastName=substr($Title,6,5);
   
$Domain=substr($Title,20,7);
   
$User=substr($Title,12,5);
   
mail("$Recipient","$Title","$Text","From:$FirstName $LastName <$User@$Domain.com>");
    Echo
"Sending Mail Number $i<BR>";
   
flush();
}
Echo
"<BR><BR><BR>*** Done sending mail ***<BR>";
?>



An email validation script that actually checks against the recipient's mail server.
Categories : Email, Complete Programs, PHP, Network, Debugging
Example of function to send out email if error occurs
Categories : PHP, Email, Debugging, Errors and Logging
Email attachment code
Categories : PHP, Email, Filesystem
A Custom Error Handling And Debugging Class
Categories : PHP, PHP Classes, Debugging, Errors and Logging
phpEasyMail: An easy way to send data from HTML-forms via EMail.
Categories : Email, HTML and PHP, Complete Programs, PHP
PhpView 0.1 - simple php viewer, using temporary files and frames.
Categories : PHP, PHP Options and Info, Debugging, HTML and PHP
PHP based Contact email form with multiple recipients, text file based, supports departments.
Categories : PHP, Email, Beginner Guides, Filesystem
Alert in JavaScript and Trace in Flash Action script are two commands that I find very much useful for tracking and debugging errors in my scripts. Unfortunately, there is no such option in PHP.
Categories : PHP, Java Script, Debugging
PHPRecommend v1.0 - Recommend this page to a friend script written in PHP. Easy to install
Categories : PHP, URLs, Complete Programs, Email, Site Planning
imap_sort
Categories : IMAP, Email, PHP, PHP Functions
simple script to send emails via a html-form to different users
Categories : Email, MySQL, PHP, Databases
Print structured array with offsets
Categories : PHP, Debugging, Arrays
Query2Report : Generating Html, Pdf and Csv Reports from SQL Query
Categories : PHP, PHP, HTML, PDF, Excel
A time measuring and performance benchmarking class
Categories : PHP, PHP Classes, Testing, Debugging, Date Time
PHP port of Matt Wrights FormMail.pl WWW form to e-mail gateway.
Categories : Email, Complete Programs, Environment Variables, PHP
 Sanjoy Roy wrote : 1291
I could not send mail using your code. I have changed the  Recipient email address to ensure it is going to my a/c but it is not doing anying. I hope it did not worked.

Hope to get your feedback soon.
 
 Boaz Yahav wrote :1292
I have noticed that some Anti Spam systems block these mails. are you using some kind of Anti Spam service?

Try to send to a Gmail address, even if it`s taken as spam, you will see it in the spam folder.

This code works for me.