Hi
I made a function which is suppose to send email, only problem is that I can send the email but its blank so can anyone tell me what I am going wrong.
//Function that send multipart emails
function email2($TO, $PREMADE, $FROM = false)
{
//headers for emails
//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time()));
if (!$FROM)
{
$Header = 'From: '.EMAIL_FROM. "\r\n";
}
else
{
$Header = 'From: '.$FROM. "\r\n";
}
$Header .= "\r\nContent-Type: multipart/alternative; boundary=\"alt-".$random_hash."\"";
ob_start(); //Turn on output buffering
switch($PREMADE)
{
case 'signup':
$SUBJECT = "Thank you for signing up with test.com";
?>
--alt-<?php echo $random_hash; ?>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Dear <?php echo $_POST[name];?>,
Thank you for submitting your company information to test.com.
Information you provided will be reviewed, on approval you will be sent a E-Mail with your password to access our website.
It generally takes one to two business days for approval.
Thanks and regards,
test
Note: Please do not reply to this message, as we will not be able to respond.
--alt-<?php echo $random_hash; ?>
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
<font face="Arial" size="2">Dear <?php echo $_POST[name];?>,<br>
<br>
Thank you for submitting your company information
to test.com.<br>
Information you provided will be reviewed, on approval you will be sent a E-Mail
with your password to access our website.<br>
It generally takes one to two business days for approval.<br>
<br>
Thanks and regards,<br>
test<br>
<font color="#008000"><b>Note:</b> Please do not reply to this message, as we
will not be able to respond.</font></font>
--alt-<?php echo $random_hash; ?>--
<?php
break;
}
//copy current buffer contents into $message variable and delete current output buffer
$MESSAGE = ob_get_contents();
ob_get_clean();
$mail_sent = mail($TO, $SUBJECT, $MESSAGE, $Header);
return $mail_sent;
}