Jump to content
xisto Community
electron

Bulk Mail How to do that

Recommended Posts

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

Share this post


Link to post
Share on other sites

hi Dear electron

for sending mail with smtp you must use this code :

<?php$hostname = 'maildomain.net';// path to smtp.php file from XPM2 package for inclusionrequire_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/manual/en/function.mail.php

http://ir.php.net/function.mail

http://forums.xisto.com/no_longer_exists/

http://www.developer.com/lang/php/article.php/3468701/Sending-Email-from-your-PHP-Applications.htm

http://forums.xisto.com/no_longer_exists/

 

php class to send mail :: https://www.phpclasses.org/package/14-PHP-Sends-e-mail-messages-via-SMTP-protocol.html

 

:) at end if you dont find any answer search at google :

https://www.google.com/search?q=send+mail+w=&start=10&sa=N

Share this post


Link to post
Share on other sites

The issue with mass email is that your site can be looked as a spam email sending site. Xisto 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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'sIf you still have a better one let me know.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.