Originariamente inviato da filippo.toso
Devi eseguire l'escaping dei singolo % all'interno dell'HTML per poter utilizzare sprintf().
Codice PHP:
$format = '<div style="width: 70%">%s</div>'; // ERRATO
$format = '<div style="width: 70%%">%s</div>'; // GIUSTO
Grazie.
Preziosissimo consiglio.
Provo e vi faccio sapere.
Edit
Risolto 
(oltre all'escaping del singolo %, ho fatto anche quello dei doppi apici [ " ] )
Grazie ancora.
Questo il codice finale
Codice PHP:
$prova=sprintf("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
<html><head>
<title>Email in HTML e CSS</title>
<meta http-equiv=\"content-type\" content=\"text/html; charset=ISO-8859-1\">
<meta name=\"generator\" content=\"HAPedit 3.1\">
</head><body>
<p style=\"margin-top:0; text-align:center; font-family: Verdana,Arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: 1.0; font-size-adjust: none; font-stretch: normal;\">
Se non visualizzi correttamente la mail, clicca <a href=\"%s\" style=\"color: #333;font-weight:bold;text-decoration:underline\">qui</a>
</p>
<div style=\"margin: 0pt auto; background: rgb(255, 255, 255) none repeat scroll 0%% 0%%; width: 500px; font-family: Verdana,Arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 1.4; font-size-adjust: none; font-stretch: normal; -x-system-font: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; color: rgb(68, 68, 68);\">
<table border=1 cellspacing=0 cellpadding=5 style=\"margin:0;font-size:12px\">
<tbody>
<tr>
<td style=\"border-top:0px solid rgb(68, 68, 68); border-left:0px solid rgb(68, 68, 68); border-right:0px solid rgb(68, 68, 68)\" valign=top>
<img src=\"logopubli.jpg\" border=0 style=\"float:left;margin: 2px 8px 3px 0\" width=100 height=110 alt=\"mare\">
<p style=\"margin-top:0; text-align:justify;\">%s
</p>
<div style=\"margin-left:-5px; border:0px solid #0099ff;background: #0099ff;color: #fff; height:20px; width:70%%;\">
</div>
<table border=0 cellspacing=5 cellpadding=5 style=\"margin:8px;font-size:12px\">
<tbody>
<tr>
<td style=\"border-top:0px solid #CCC; border-left:0px solid #CCC; align=center\">
<img src=\"%s\" border=0 width=140 height=140 alt=\"Template numero 1\">
<p style=\"margin-top:0; text-align:center;\">template 01 </p>
</td>
<td>
<img src=\"%s\" border=0 width=140 height=140 alt=\"Template numero 2\">
<p style=\"margin-top:0; text-align:center;\">template 02 </p>
</td>
<td>
<img src=\"%s\" border=0 width=140 height=140 alt=\"Template numero 3\">
<p style=\"margin-top:0; text-align:center;\">template 03 </p>
</td>
</tr>
</tbody>
</table>
<div style=\"margin-top:-10px; margin-left:152px; border:0px solid #0099ff;background: #0099ff;color: #fff; height:20px; width:70%%;\">
</div>
<a href=\"mailto:xxx@xxx.com\" style=\"padding-bottom: 4px; margin-left:0px; padding-left: 5px; text-decoration:none; font-family: Verdana,Arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: 1.0; font-size-adjust: none; font-stretch: normal; color:#333;\"><img src=\"http://images/phone.gif\" border=0>%s</a>
<a href=\"mailto:xxx@xxx.com\" style=\"padding-bottom: 4px; margin-left:0px; padding-left: 5px; text-decoration:none; font-family: Verdana,Arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: 1.0; font-size-adjust: none; font-stretch: normal; color:#333;\"><img src=\"http://images/mail.gif\" border=0>%s</a>
<a href=\"http://www.xxx.com\" style=\"padding-bottom: 4px; margin-left:0px; padding-left: 5px; text-decoration:none; font-family: Verdana,Arial,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: 1.0; font-size-adjust: none; font-stretch: normal; color:red;\"><img src=\"http://images/home.gif\" border=0>[url]www.xxx.com[/url]</a>
</td>
</tr>
</tbody>
</table>
</div>
</body>