send PHP mail with Content-Type: multipart/alternative

后端 未结 4 1412
抹茶落季
抹茶落季 2020-12-11 19:37

I am trying to send a multipart mail that contains both html and plain text. This is also one of the ways to get through spam filters and to allow more people to read the ma

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 19:43

    Try this example https://github.com/breakermind/PhpMimeParser/blob/master/PhpMimeClient_class.php

    $m = new PhpMimeClient();
    // Add to
    $m->addTo("email@star.ccc", "Albercik");
    $m->addTo("adela@music.com", "Adela");
    // Add Cc
    $m->addCc("zonk@email.au");
    // Add Bcc
    $m->addBcc("boos@domain.com", "BOSS");    
    // Add files inline
    $m->addFile('photo.jpg',"zenek123");
    // Add file
    $m->addFile('sun.png');
    // create mime
    $m->createMime("Witaj!",'

    Witaj jak się masz?

    ',"Wesołych świąt życzę!","Heniek Wielki", "hohoho@domain.com"); // get mime // $m->getMime(); // Show mime echo nl2br(htmlentities($m->getMime()));

提交回复
热议问题