Include html in email

后端 未结 4 1352
遇见更好的自我
遇见更好的自我 2020-12-22 12:02

I need to include some HTML things in PHP, for example to add link in a message like this:



        
4条回答
  •  猫巷女王i
    2020-12-22 12:51

    php.net/mail has a lot of examples

    
    
      Birthday Reminders for August
    
    
      

    Here are the birthdays upcoming in August!

    PersonDayMonthYear
    Joe3rdAugust1970
    Sally17thAugust1973
    '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary , Kelly ' . "\r\n"; $headers .= 'From: Birthday Reminder ' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?>

    I also found this article useful:

    PHP: Sending Email (Text/HTML/Attachments)

提交回复
热议问题