Click to See Complete Forum and Search --> : PHP functions in mail function


appezatto
07-26-2001, 06:21 AM
Hi ....

Is it possible to put some php commands in the message body in mail function ?

Ex.
$to = "someone@someserver.com";
$subject = "Some subject";
$body = "
<table width=\"75%\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
$query14=ifx_prepare("SELECT * FROM ordem_sup where num_pedido = '$cod[0]'
and cod_empresa = '$cod[1]' and ies_versao_atual = 'S' order by cod_empresa, cod_item, num_oc",$DBH_INF,IFX_SCROLL);
if (! ifx_do ($query14)) {
print "ERRO DO";
}
$ordem_sup = @ifx_fetch_row ($query14, "NEXT");
";
$header = "Content-type: text/html\r\nFrom: Webmaster";

mail ($to,$subject,$body,$header);

I need to make some searches in my database in order to send some infomration ...

thanks in advance....

Anon
07-30-2001, 08:59 AM
you can concatenate these items into your $body but not like this.

try:

$body = "<table width=\"75%\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>";

$query14=ifx_prepare("SELECT * FROM ordem_sup where num_pedido = '$cod[0]'
and cod_empresa = '$cod[1]' and ies_versao_atual = 'S' order by cod_empresa, cod_item, num_oc",$DBH_INF,IFX_SCROLL);

if (! ifx_do ($query14)) {
$html .= "ERRO DO";
}
else
{
$html .= @ifx_fetch_row($query14, "NEXT");
}


now, mail $body.