Emailing through php
Posted: Thu Mar 20, 2008 10:35 am
I have a mysql table called user with the following fields.
I want to design a html form which will personalized emails to each one of the members above. The html form has the follings 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:
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.
Code: Select all
fname lname email
John Doe john.doe@something.com
Ed Mass ed.mass@something.com
luke samon luke.samon@something.com
pal gets pal.gets@something.com
I want to design a html form which will personalized emails to each one of the members above. The html form has the follings 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:
Then the script should pick up the email address of "luke" and send the email.Hello Luke,
How are you? This is just a test email.
Thank you.
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.