sudip_dg77 Posted March 20, 2008 Share Posted March 20, 2008 I have a mysql table called user with the following fields. fname lname email John Doe [email protected] Ed Mass [email protected] luke samon [email protected] pal gets [email protected] I want to design a html form which will personalized emails to each one of the members above. The html form has the following items in the form. Subject(a text field with the name subject) Body(a text field with the name body) Now I am designing a php script to be called on the submit action of the above html form which should do the following> Pick up the first name of the person to whom I am sending the email and if the first letter of the name is in small letters change that to capital letter. Like for example in row number 3 of the table shown above the first name is "luke", which starts with a small letter "l", the php script should convert this small letter "l" to capital letter "L". So that it starts the email like as below: Hello Luke, How are you? This is just a test email. Thank you. Then the script should pick up the email address of "luke" and send the email. Then it should move on to the next row and do the same. But if the script finds that the first name starts with a capital letter it should not convert it into capital letter and keep it as it is and send the email. So basically I am looking for two things here: 1. Send out personalized emails to everybody in the table one by one untill the end of table is reached. 2. Before sending out the email if the first name of the person starts with a small letter then convert it into capital letter and then send the email. Can anyone give an example PHP script to do this? Thanks for your help in advance. Link to comment https://forums.phpfreaks.com/topic/97103-php-bulk-mailing/ Share on other sites More sharing options...
BlueSkyIS Posted March 20, 2008 Share Posted March 20, 2008 you must: 1. retrieve the records from the database 2. loop over each record, mail()'ing your message to the recipient 3. use ucwords($string) to upper case the first character of each word. what have you got so far? what don't you understand? Link to comment https://forums.phpfreaks.com/topic/97103-php-bulk-mailing/#findComment-496853 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.