954,604 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

SMTP script problem!

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'];."`
`".echo $row_incumplimientos_caso['1'];."`
Cargo por incumplimiento <b>`".echo '$' . $row_incumplimientos_caso['3'] . 'USD';."`</b>
</td>
<td bgcolor=`".echo $row_color;."` align='center'>`".echo $row_incumplimientos_caso['2'];."`</td>
<td bgcolor=`".echo $row_color;."`>`".echo $row_incumplimientos_caso["4"];."`</td>
</tr>
`".
$row_count++;
}
."`
</table>
");
carlogl
Newbie Poster
4 posts since Jun 2010
Reputation Points: 10
Solved Threads: 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.

SikoSoft
Junior Poster in Training
55 posts since May 2010
Reputation Points: 14
Solved Threads: 8
 

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.

carlogl
Newbie Poster
4 posts since Jun 2010
Reputation Points: 10
Solved Threads: 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.

ingeva
Junior Poster
106 posts since Jul 2008
Reputation Points: 16
Solved Threads: 9
 

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

carlogl
Newbie Poster
4 posts since Jun 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: