Swiftmailer mails go into SPAM Folder
问题 $headers = "\r\n" . "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $message = Swift_Message::newInstance() ->setSubject($subject) ->setFrom(array('from@mail.com' => 'From Address')) ->setTo(array('to@mail.com' => 'To Address')) ->setBody($message_plain_txt) ->addPart($message, 'text/html') ; if ($file_name) { $message->attach(Swift_Attachment::fromPath($file_path)); } $result = $mailer->send($message); In this case $filepath is the tmp path