0

I have problems with this part of my code, I try to make a dynamic email and send it, I already can send a plain email with this but now I need to make an email with personalized info.

I hope you guys can take a quick look.

$smtp -> setBody("
<table>
<tr align='center'>
<td width='50%' bgcolor='#E4028C'><strong>Detalles de incumplimiento</strong></td>
<td width='20%' bgcolor='#E4028C'><strong>L&iacute;mite</strong></td>
<td width='30%' bgcolor='#E4028C'><strong>Comentario</strong></tr>
</tr>
`".
$color1 = '#d74119';
$color2 = '#c5281c';
$row_count = 0;

while($row_incumplimientos_caso = mysql_fetch_array($result_incumplimientos_caso))
{
$row_color = ($row_count % 2) ? $color1 : $color2;
."`
<tr>
<td bgcolor='`".echo $row_color;."`'>
`".echo $row_incumplimientos_caso['0'];."`<br />
`".echo $row_incumplimientos_caso['1'];."`<br /><br />
Cargo por incumplimiento <b>`".echo '$' . $row_incumplimientos_caso['3'] . 'USD';."`</b>
</td>
<td bgcolor=`".echo $row_color;."` align='center'>`".echo $row_incumplimientos_caso['2'];."`<br /></td>
<td bgcolor=`".echo $row_color;."`>`".echo $row_incumplimientos_caso["4"];."`</td>
</tr>
`".
$row_count++;
}
."`
</table>
");
3
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by carlogl
0

What exactly is your problem - that wasn't really clear. What is and isn't working, and what did you need help with?

One thing I notice right off the bat is that it looks to me like you are echoing data out to the browser that you are probably intending on putting into a variable to use as the message's body.

0

Hi SikoSoft I'm sorry if i not explain very well, I'm trying yo put all that HTML code into a variable and then send it as an email but I have several parse errors but I don't understand what happens.

0

Hi SikoSoft I'm sorry if i not explain very well, I'm trying yo put all that HTML code into a variable and then send it as an email but I have several parse errors but I don't understand what happens.

... that you build the html code separately, and display it as a HTML page. View source as needed. THEN you can worry about the mailing.

0

thanks everyone, the problem was the concatenation but is now fixed

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.