I would strongly recommend using a library like PHPMailer to send emails.
It's easier and handles most of the issues automatically for you.
Gömülü (inline) görüntüme ilişkin, burada ne var their documentation:
Inline Eklentiler
There is an additional way to add an
attachment. If you want to make a HTML
e-mail with images incorporated into
the desk, it's necessary to attach the
image and then link the tag to it. For
example, if you add an image as inline
attachment with the CID my-photo, you
would access it within the HTML e-mail
with <img src="cid:my-photo"
alt="my-photo" />
.
In detail, here is the function to add
an inline attachment:
$mail->AddEmbeddedImage(filename, cid, name);
//By using this function with this example's value above, results in this code:
$mail->AddEmbeddedImage('my-photo.jpg', 'my-photo', 'my-photo.jpg ');
Sana nasıl çalışır daha eksiksiz bir örnek vermek gerekirse:
<?php
require_once('../class.phpmailer.php');
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->IsSMTP(); // telling the class to use SMTP
try {
$mail->Host = "mail.yourdomain.com"; // SMTP server
$mail->Port = 25; // set the SMTP port
$mail->SetFrom('name@yourdomain.com', 'First Last');
$mail->AddAddress('whoto@otherdomain.com', 'John Doe');
$mail->Subject = 'PHPMailer Test';
$mail->AddEmbeddedImage("rocks.png", "my-attach", "rocks.png");
$mail->Body = 'Your <b>HTML</b> with an embedded Image: <img src="cid:my-attach"> Here is an image!';
$mail->AddAttachment('something.zip'); // this is a regular attachment (Not inline)
$mail->Send();
echo "Message Sent OK<p></p>\n";
} catch (phpmailerException $e) {
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
?>
Edit:
Regarding your comment, you asked how to send HTML email with embedded images, so I gave you an example of how to do that.
The library I told you about can send emails using a lot of methods other than SMTP.
Take a look at the PHPMailer Example page for other examples.
Eğer kütüphanesi tarafından desteklenen şekilde e-posta göndermek istemiyorsanız, yine mesajı oluşturmak için kütüphane kullanımı (gereken) bir yolu ya da diğer, o zaman bunu istediğiniz şekilde gönderin.
Örneğin:
Sen e-posta göndermek satırı değiştirebilirsiniz:
$mail->Send();
Bu grubu:
$mime_message = $mail->CreateBody(); //Retrieve the message content
echo $mime_message; // Echo it to the screen or send it using whatever method you want
Hope that helps.
Let me know if you run into trouble using it.