开发者

Headers and MIME types for HTML email messages (sending through PHP)

开发者 https://www.devze.com 2022-12-20 20:54 出处:网络
What is the correct header information and MIME types for an email message with HTML content only, not mixed type (with bo开发者_JAVA百科th text and HTML).

What is the correct header information and MIME types for an email message with HTML content only, not mixed type (with bo开发者_JAVA百科th text and HTML).

Just to inform, I am using Swiftmailer (PHP) to this job.


This is my code:

$swift = new stdClass();
$swift->transport = Swift_SendmailTransport::newInstance( '/usr/sbin/sendmail -bs' );
$swift->mailer = Swift_Mailer::newInstance( $swift->transport );
$swift->message = Swift_Message::newInstance('Title')
    ->setFrom( array('from@my.email' => 'Me') )
    ->setTo( array( 'to@some.one' => 'Some One' ) )
    ->setBody('<h1>It works!</h1>', 'text/html');

You can also take a look at the Headers documentation on http://swiftmailer.org/docs/headers

0

精彩评论

暂无评论...
验证码 换一张
取 消