これは、イメージ タグを含む送信メールがスパム メールボックスに送信されているようです。
gmail などのメール プロバイダーを使用していますか? ほとんどの場合、信頼できないメッセージを直接スパム フォルダに投げ込みます。信頼されていないアカウントとは、新しく登録されたアカウントを意味します。
PHP のネイティブmail()
関数で送信されたメールが迷惑メールとして検出されることは、今に始まったことではありません。これは、php がメッセージ ヘッダーを準備する方法です。
そのため、 SwiftMailerのような php メール ライブラリを使用するのが最善の方法です。優れたカスタマイズ オプションを提供し、添付ファイル付きのメールの送信をより簡単にする機能を備えています。
確認してください: http://swiftmailer.org/docs/messages.html#attaching-files
SwiftMailer を使用して、画像が添付された電子メール メッセージを送信する方法の例を次に示します。
<?php
require_once 'lib/swift_required.php';
// Create the Transport
$transport = Swift_SmtpTransport::newInstance('smtp.example.org', 25)
->setUsername('your username')
->setPassword('your password');
// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
// Create the message
$message = Swift_Message::newInstance()
// Give the message a subject
->setSubject('Your subject')
// Set the From address with an associative array
->setFrom(array('john@doe.com' => 'John Doe'))
// Set the To addresses with an associative array
->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name'))
// Give it a body
->setBody('Here is the message itself')
// And optionally an alternative body
->addPart('<q>Here is the message itself</q>', 'text/html');
// Add the attachment
$message->attach(Swift_Attachment::fromPath('/path/to/image.jpg'));
// Send the message
$result = $mailer->send($message);
試してみる。