When we send only html email, it still have problems. How if someone is using a mail client that cannot understand HTML email. To solve this problems, it is best to send any HTML email as dual format. This means providing both a text and an HTML version in the same email. Your client can choose which version to display.
03 | date_default_timezone_set( 'America/New_York' ); |
05 | $to = "you@phpeveryday.com" . ", " ; |
06 | $to .= "we@phpeveryday.com" ; |
09 | $subject = "Test for HTML Format" ; |
12 | $sep = sha1( date ( 'r' , time())); |
17 | "\r\nContent-Type: multipart/alternative; |
18 | boundary=\ "PHP-alt-{$sep}\"" ; |
21 | $headers .= "To: You <you@phpeveryday.com>, |
22 | We <we@phpeveryday.com>\r\n"; |
23 | $headers .= "From: Me <me@miscellaneous4all.com>\r\n" ; |
24 | $headers .= "Cc: he@miscellaneous4all.com\r\n" ; |
25 | $headers .= "Bcc: she@miscellaneous4all.com\r\n" ; |
30 | Content-Type: text/plain |
35 | Content-Type: text/html |
39 | <title>Test HTML Mail</title> |
42 | <font color= 'red' >Hai, it is me!</font> |
50 | mail( $to , $subject , $body , $headers ); |
52 | </me@miscellaneous4all.com> |
0 comments:
Post a Comment