Forum Moderators: skibum

Message Too Old, No Replies

email sender

Coding help

         

VideoG

2:38 pm on Sep 18, 2009 (gmt 0)

10+ Year Member



Hi Everybody,
I have the following script provided in the template I purchased. My server needs the SMTP email server and password included in the script to complete the process. As I am new to php, I have no idea where & how do I provide the script for this to function. The existing code is as follows:

<?

function send_html($from, $to, $subject, $text, $html)
{
global $debug;
if ($debug) echo "<HR>DEBUG¦From:$from¦To:$to¦Subject:$subject<HR>$text<HR>$html<HR>";
$headers = "From: $from\r\n";
$headers .= "Reply-To: $from\r\n";
$headers .= "X-Mailer: PHP/" . phpversion()."\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$boundary = uniqid("MAB");
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";
$headers .= "$text\r\n\r\n";
$headers .= "--$boundary\r\n" .
"Content-Type: text/plain; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("$text"));
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode("$html"));
mail($to, $subject, "", $headers);
}

function parse_mail($mail, $param)
{
foreach ($param as $key=>$val)
$mail=str_replace("#".$key."#",$val,$mail);
return $mail;
}
?>

Thanks in advance
Best regards
VideoG

VideoG

4:44 am on Sep 19, 2009 (gmt 0)

10+ Year Member



c