Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Bulk Mail, How to do that
electron
post 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
Go to the top of the page
 
+Quote Post
farsiscript
post 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

smile.gif at end if you dont find any answer search at google :
http://www.google.com/search?q=send+mail+w...=&start=10&sa=N

Go to the top of the page
 
+Quote Post
BuffaloHELP
post Jul 23 2006, 08:15 AM
Post #3


Desperately seeking "any key" to continue...
Group Icon

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.
Go to the top of the page
 
+Quote Post
electron
post 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.
Go to the top of the page
 
+Quote Post
rvalkass
post Jul 23 2006, 01:21 PM
Post #5


apt-get moo
Group Icon

Group: [MODERATOR]
Posts: 2,153
Joined: 28-May 05
From: Devon, England
Member No.: 7,593
Spam Patrol



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.
Go to the top of the page
 
+Quote Post
electron
post 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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Contact Form(2)
  2. Php G-mail Login(8)
  3. Build Contact Mail(3)
  4. Form To Php Mail. Attachment(14)
  5. Send Mail In Strict Xhtml(2)
  6. How To Enable Mail() Function In Php(1)
  7. Question About The Mail() Function(2)
  8. Help With Mail And Attachments(4)
  9. Wappymail_v1.50(15)
  10. Want To Send Mail But Smtp Disabled, Help Me!(7)
  11. Mail() Clone(5)
  12. Prequirement For Mail()(1)
  13. Php Functions To Send Mail(9)
  14. Requirements For Mail()(2)
  15. A Question About Php Mail(1)


 



- Lo-Fi Version Time is now: 12th October 2008 - 11:12 AM