Created
April 25, 2014 16:18
-
-
Save miwebguy/11295023 to your computer and use it in GitHub Desktop.
MultiPartEmail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function SendNews($to,$subject,$emailText,$emailHtml) { | |
| global $fromName,$fromEmail,$MoPixList; | |
| //TEXT FORMAT | |
| //Plain Text Boundary of Email Message for Non-HTML browsers | |
| $message=" | |
| --==Multipart_Boundary_xc75j85x | |
| Content-Type: text/plain; charset=\"iso-8859-1\" | |
| Content-Transfer-Encoding: 7bit | |
| "; | |
| $message.=$emailText; | |
| //HTML FORMAT | |
| //HTML Email Boundary | |
| $message.=" | |
| --==Multipart_Boundary_xc75j85x | |
| Content-Type: text/html; charset=\"iso-8859-1\" | |
| Content-Transfer-Encoding: 7bit | |
| "; | |
| //End of HTML Multipart Boundary | |
| $message.=$emailHtml . " | |
| --==Multipart_Boundary_xc75j85x--"; | |
| //Email Mime-Type for text/HTML email | |
| $header.="From: $fromName < $fromEmail >\n\r"; | |
| //$header.="Bcc: " . $MoPixList . "\n\r"; | |
| $header.='MIME-Version: 1.0 | |
| Content-Type: multipart/alternative; | |
| boundary="==Multipart_Boundary_xc75j85x"'; | |
| //mail ('anyone@grwebguy.net',$subject,$message, $header); | |
| mail ($to, $subject,$message, $header); | |
| echo $emailHtml; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment