Current location: Hot Scripts Forums » Programming Languages » PHP » PHP Mail with database

PHP Mail with database

  #1 (permalink)  
New Member
Join Date: Aug 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Talking PHP Mail with database

Im fairly new to this forum I have a problem I need help with its driving me mad.
I'm trying to mail some invites to a show im exhibiting in as a business I created a script that fetches all the records from the database
the script works fine if im sending 1 email at a time but the reason i created the script is to send out all emails at once to save time my BT broadband connection at work has a relay on the SMTP meaning all outgoing needs authentication,this means that when it takes time to send it gives me errors is there anyway I can configure this so as it continues to with them even in the relay. as my database has 200 records which I thought in php would be sent out instantly... but it just starts out and then stops midway...

hope someone can help


Reply With Quote

Featured Marketplace Scripts (view more)

  #2 (permalink)  
New Member
Join Date: Aug 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
I am no expert by any means, but if I understand correctly, then you should use authentication to your SMTP gateway and use PEAR Mail. Plenty of internet stuff on this.

// Must have PEAR Mail Installed
require_once "Mail.php";

// Set email body
$email_body = "Hello World.";

// Setup Email Parameters
$headers = array ('From' => $email_from,
'To' => $email_to,
'Subject' => $email_subject,
'Cc' => $email_cc);
$smtp = Mail::factory('smtp',
array ('host' => $email_host,
'port' => $email_port,
'auth' => true,
'username' => $email_username,
'password' => $email_password));

// Send Email
$mail = $smtp->send($email_recpt, $headers, $email_body);
Reply With Quote
  #3 (permalink)  
Old's Avatar
Newbie Coder
Join Date: Nov 2010
Location: Setúbal, near Lisbon
Posts: 96
Thanks: 3
Thanked 7 Times in 7 Posts
Why not send it as BCC, and use all the email adresses at te same time?
For example, gmail allows you to send an email up to 500 adresses at one time.
You can allways find me at, I own it.
And if you are hiring, I 'm all ears, now.
Reply With Quote
  #4 (permalink)  
New Member
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Look into PEAR's mail_queue.
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attachement help needed sujata_ghosh Perl 18 06-22-07 01:00 PM
PHP Security alert: PHP mail() Function Lets Remote Users Inject E-mail Headers darkerstar PHP 4 04-29-07 07:14 PM
Php needed for Education Database to revolutionize learning Mystefier Job Offers & Assistance 2 09-10-05 12:52 PM

All times are GMT -5. The time now is 02:00 AM.
vBulletin® Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.