9 Replies - 33089 Views - Last Post: 26 September 2007 - 07:27 AM Rate Topic: -----

#1 nitro23456  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 21-January 07

Using PHP to send email from MYSQL

Posted 21 January 2007 - 07:21 AM

Hi all

I have built a site with a mySQL database into which my users submit their contact info such as name, phone, email etc etc

I want to send an email to all the email addresses stored in my 'table'

Can someone suggest a script as to how to do this?
Is This A Good Question/Topic? 0
  • +

Replies To: Using PHP to send email from MYSQL

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Using PHP to send email from MYSQL

Posted 21 January 2007 - 08:11 AM

http://email.about.c...qt/et031202.htm

http://www.smartwebb...mailsending.asp

http://www.totallyph...il_function.htm

http://ca3.php.net/mail

http://www.advancesc...tailed/814.html

http://www.hostmysit...amming/phpmail/
Was This Post Helpful? 0
  • +
  • -

#3 nitro23456  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 21-January 07

Re: Using PHP to send email from MYSQL

Posted 21 January 2007 - 08:24 AM

View PostAmadeus, on 21 Jan, 2007 - 08:11 AM, said:



thankyou

But I already know how to send email using php - I dont know how to automatically include all the email addresses stored in my database.

I dont want to have to enter them all manually - I want to point the php at the databse to do it and send them all the same email - how?

This post has been edited by nitro23456: 21 January 2007 - 08:26 AM

Was This Post Helpful? 0
  • +
  • -

#4 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Using PHP to send email from MYSQL

Posted 21 January 2007 - 08:58 AM

There are several ways. One of the would be to select all addresses from the DB, and loop through the resulting recordset to call the mail function for each. Another would be to select all addresses, loop through the result concatenating each address into a single string, and using that string as the TO line.
Was This Post Helpful? 0
  • +
  • -

#5 nitro23456  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 21-January 07

Re: Using PHP to send email from MYSQL

Posted 21 January 2007 - 09:02 AM

any suggestion for the script?

I dont know a lot about how to script it :crazy:
Was This Post Helpful? 0
  • +
  • -

#6 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Using PHP to send email from MYSQL

Posted 21 January 2007 - 12:48 PM

Is it the extraction of information from the database that you'd like a script for, or looping using PHP to either concatenate the addresses int one string or to call the mail function?
Was This Post Helpful? 0
  • +
  • -

#7 nitro23456  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 21-January 07

Re: Using PHP to send email from MYSQL

Posted 21 January 2007 - 01:39 PM

all of it mate - I havent really got a clue how to do it!

Id like an html form for me to fill in and when I click 'send' it just does it for me....

any help would be very very appreciated! B)

This post has been edited by nitro23456: 21 January 2007 - 01:40 PM

Was This Post Helpful? 1
  • +
  • -

#8 wzeller  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 3
  • View blog
  • Posts: 78
  • Joined: 09-April 06

Re: Using PHP to send email from MYSQL

Posted 22 January 2007 - 11:41 AM

View PostAmadeus, on 21 Jan, 2007 - 08:58 AM, said:

There are several ways. One of the would be to select all addresses from the DB, and loop through the resulting recordset to call the mail function for each. Another would be to select all addresses, loop through the result concatenating each address into a single string, and using that string as the TO line.


I know this doesn't help much on the "how-to" front, but I feel I must interject: If you decide to use all the addresses in a single address line, please please please please make it the BCC line and NOT the TO line. If you do it in the TO field, you'll irritate all of your recipients by sharing their email addresses with all the other recipients. Use the BCC line to protect your recipients from spam and from violation of their privacy.

Wayne
Was This Post Helpful? 0
  • +
  • -

#9 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Using PHP to send email from MYSQL

Posted 22 January 2007 - 12:48 PM

Poor choice of words on my part, perhaps. I was focused on the mechanics, and not the etiquette. :)
Was This Post Helpful? 0
  • +
  • -

#10 wongtony  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-September 07

Re: Using PHP to send email from MYSQL

Posted 26 September 2007 - 07:27 AM

Thank you and it works
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1