Hi,
Could somebody help me?
The problem is:
I woild like my PHP program to be able to send an Email with in the content of the body, a table whose rows are extracted from a MySQL database. To do this I have included php instructions inside a variable named $body containing the htlm + php codes.
It does not work so I would appreciate to knwo if somenoe have solved yet thsi kind of problem.
Thanks and regards
Eric
Need help in php to send automatically an Email.
Moderator: General Moderators
-
Frenchdeveloper
- Forum Newbie
- Posts: 2
- Joined: Wed Jun 01, 2005 1:07 pm
- Location: France
a header to indicate to mail clients you're using html you will need.
add to your $body var you will need:
ex:
as mentioned, more headers you will need in your body tag.
recommend I do that you research mail()
add to your $body var you will need:
ex:
Code: Select all
$body = "Content-type: text/html;";
while($row=mysql_fetch_assoc($result)){
$body .= "Column 1:".$row['colone']."<br>";
$body .= "Column 2:".$row['coltwo']."<br>";
//etc
}
//now use the mail function to send it...**NOTE, you will need to add additional headers
mail($to,$subject,$body);recommend I do that you research mail()
-
Frenchdeveloper
- Forum Newbie
- Posts: 2
- Joined: Wed Jun 01, 2005 1:07 pm
- Location: France
THANK YOU VERY MUCH
Hi,
Thank you so much for your answer,I have not tried yet, I do it now but I am convinced that your answer is THE solution to the problem I was facing.
THANK YOU VERY MUCH.
Eric

Thank you so much for your answer,I have not tried yet, I do it now but I am convinced that your answer is THE solution to the problem I was facing.
THANK YOU VERY MUCH.
Eric