|
|
|
|
![]() ![]() |
Jul 23 2006, 07:27 AM
Post
#1
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 162 Joined: 10-May 06 Member No.: 23,375 |
Hey ,
I have a problem . I wanted a script to send emails using PHP to more than 5000 email addresses for my software. But if you use the regular mail() function it will cause tremendous overload o the servers. I tried searching on the net but no use and i found some pre-built ones which are either copyrited or using PHP 5 only. But I want to make my own function to send Bulk Mails. If someone could give me a start I would be thankful. So does any one know how to send bulkmail. Also I needed to give an option of using SMTP servers if PHP mail is not supported on the LOCALHOST. Please Help |
|
|
|
Jul 23 2006, 08:15 AM
Post
#2
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 357 Joined: 8-April 06 Member No.: 21,487 |
hi Dear electron
for sending mail with smtp you must use this code : CODE <?php $hostname = 'maildomain.net'; // path to smtp.php file from XPM2 package for inclusion require_once '/path/smtp.php'; $mail = new SMTP; $mail->Delivery('client'); $mail->From('me@'.$hostname, 'My name'); $mail->FromHost($hostname, $havemx); if(!$havemx) die("The hostname: '".$hostname."' doesn't have a valid MX zone!"); $mail->AddTo('client@destination.net'); $mail->Text('It is simple to use XPM2'); $sent = $mail->Send('Hello World!'); echo $sent ? 'Success.' : $mail->result; ?> for more info about sending email you can must view these address : Help url : http://ir.php.net/mail http://ir.php.net/function.mail http://www.phpfreaks.com/tutorials/130/7.php http://www.developer.com/lang/php/article.php/3468701 http://www.phprojekt.com/modules.php?file=...modload&sid=143 php class to send mail :: http://www.phpclasses.org/browse/package/14.html http://www.google.com/search?q=send+mail+w...=&start=10&sa=N |
|
|
|
Jul 23 2006, 08:15 AM
Post
#3
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,492 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
The issue with mass email is that your site can be looked as a spam email sending site. Trap17 server admins may not look kindly at you.
There's a script called PHPList (under your cPanel, Fantastico) which gives you unlimited email listing and can support SMTP or PHP Mail(). It has built-in safty timer where it sends X amount at a time in intervals of 15, 30, or 60 minutes. It also features resume sending when interrupted. This script supports import and export of email lists using CSV. If your search fails give this script a try. |
|
|
|
Jul 23 2006, 10:16 AM
Post
#4
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 162 Joined: 10-May 06 Member No.: 23,375 |
Actually I am trying to make this script for my Software.
I found something Good on pear.php.net . My software will be distributed and used. So its not for my personal use but to integrate in my software which would be having capabilities to send Newsletters to its members. |
|
|
|
Jul 23 2006, 01:21 PM
Post
#5
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,153 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
The reason that mail() is so resource-hogging is that each time it loops to send a message it opens a new connection, collects the message information, sends the message, clears the information and closes the connection. If you use sockets you use 1 connection for all the messages, so you severly reduce the load on the server, and it works much faster for sending a lot of messages, especially if they are mostly the same content.
There is an example script here in the comment by josephcmiller2 at gmail dot com. I don't have a huge amount of experience sending mail with sockets, but some research on the Internet should help. |
|
|
|
Jul 24 2006, 04:03 AM
Post
#6
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 162 Joined: 10-May 06 Member No.: 23,375 |
I had read that thing before.
But it sends only one email not bulk. But i will modify it to loop through to send many emails. To test the script I dont know how much load will it cause. Got to read all those RFC's If you still have a better one let me know. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 11:12 AM |