views:

51

answers:

3

I have a problem sending HTML emails from a PHP form.

My goal is to send an email in HTML format with a picture embedded in it. It works perfectly if the destination address is a gmail.com email, but it doesn't seem to arrive to any other address.

What am I doing wrong?

$header = "From: Private PictureBank MDC <[email protected]>\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html;\n";    

$messaggio = "<html><body>Galleria Massimo De Carlo<br /><br /><p><b><i>".$titolo.",</i></b> ".$anno."<br />".$dimensioni."</p><img src=\"".$foto."\"></body></html>\n";

$subject = $titolo;

if(!@mail($mail, $subject, $messaggio, $header) ){
    $esito=  "Errore nell'invio dell'e-mail,<br />riprova reinserendo l'indirizzo mail!";
}else{
    $esito = "Email inviata correttamente!";
}
A: 

This one is a quite good article about inline HTML images:

http://www.websiteoptimization.com/speed/tweak/inline-images/

Hope it helps.

JochenJung
A: 

Most probably images are not embedded properly. In Gmail it works, since it automatically previews attachments.

spektom
A: 

Is your variable for the image a full url like "http://www.somesite.com"

What happens when you view source on non-gmail email clients?

Don