Jump to content

Sending e-mail

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
Divya

Divya

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts
I have created an address book using php and mysql...I have provided check boxes for all my contacts list.Now my requirement is that i just want to check the required contacts and send e-mail to all those checked contacts at once..Is it possible with php?

#2
adserverexpert

adserverexpert

    Newbie

  • Members
  • PipPip
  • 21 posts
ya its possible in php. you want to post checked contacts email id. then through loop you can do that

#3
morefood2001

morefood2001

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,720 posts
Its quite simple,

First query the sql database and display all the email addresses with a check box next to them (name the check box via id) in a html form. On submit, get the ids that are checked (true) and query the database for those email addresses. Then use the php mail function to send the email. You will need to make the emails comma separated "a@cc.net, b@cc.net". That should do the trick :)

#4
ArtoStiloz

ArtoStiloz

    Programmer

  • Members
  • PipPipPipPip
  • 175 posts
Of course, it is possible.
Use the mail()

This article may be helpful:
dk2.php.net/manual/en/book.mail.php

#5
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

Divya said:

I have created an address book using php and mysql...I have provided check boxes for all my contacts list.Now my requirement is that i just want to check the required contacts and send e-mail to all those checked contacts at once..Is it possible with php?

Your contacts database needs to have a boolean column (lets call it sendEmail) that represents the state of the check box - 1 implies checked, 0 unchecked. Simply iterate through your entire table, using a while loop, and if "sendEmail" is 1, send that user an email using the mail() function.

#6
ArtoStiloz

ArtoStiloz

    Programmer

  • Members
  • PipPipPipPip
  • 175 posts
Headers and title must also be included using the mail sent, but said a look at this link:
PHP: Mail - Manual

You get the use of mail() function :)
[SIGPIC][/SIGPIC]
Http://www.ArtoStiloz.Dk